This method considers special cases where a simpler algorithm would return "ugly" results.

For example when the expression (-1e40)^0.5 is evaluated without considering the special case, the argument of the base is the double number closest to pi. When Sin and cos are used for the final evaluation of the result, the slight difference of the argument from pi causes a non-zero value for the real component of the result. Because the value of the base is so high, the error is magnified. Although the error is normal for floating point calculations, the consideration of commonly occurring special cases improves the accuracy and aesthetics of the results.

If you know a more elegant way to solve this problem, please let me know at nathan.funk@singularsys.com .

**Namespace:**
SingularSys.Jep.Types

**Assembly:**
Jep (in Jep.dll) Version: 1.1.0.0 (1.0.0)

# Syntax

C# |
---|

public Complex Pow( double exponent ) |

Visual Basic (Declaration) |
---|

Public Function Pow ( _ exponent As Double _ ) As Complex |

Visual C++ |
---|

public: Complex^ Pow( double exponent ) |

#### Parameters

- exponent
- Type: System..::.Double