StringToComplex

Converts a string containing the character representation of a complex number to a complex value.

complex StringToComplex(
   string  value     // string
   );

Parameters

value

[in]  String containing the character representation of a complex number.

Return Value

Value of type complex.

Example:

   vectorc vecc=vectorc::Random(10,-1.0-1i,1+1i);
   string  str_complex=ComplexToString(vecc[0]);
   Print(str_complex);
   complex value=StringToComplex(str_complex);
   Print(value);
 
  /*
   (0.55906387,-0.18868503)
   (0.55906387,-0.18868503)
  */

See also

Complex number (complex, complexf), ComplexToString