[back] [prev] [next] [index] [root]

 


Sqrt

Returns a square root of a number.

Syntax:

y := Sqrt(x);

complex or real
  y  
complex or real or rational or integer
  x  

Description:

Given x in Z, Q or R the function returns \sqrt{ x} if x>0 or i\sqrt{| x|}, otherwise. For x=| x|e^{i\phi}\inC, \phi\in (-\pi,\pi], the function returns \sqrt{| x|} e^{ifrac{\phi}{2}}. The computation is done in the current precision of the real (complex) field.


Example:


kash> Sqrt(2);
1.414213562373095048801688724209698078569671875377
kash> Sqrt(-2);
1.414213562373095048801688724209698078569671875377*i
kash> i := Comp(0, 1);
1*i
kash> Sqrt(i);
0.7071067811865475244008443621048490392848359376883159 + 0.7071067811865475244\
008443621048490392848359376886321*i
kash> Sqrt(-i);
> 0.7071067811865475244008443621048490392848359376883159 - 0.7071067811865475244\
008443621048490392848359376886321*i


<- back[back] [prev] [next] [index] [root]