Changeset 15407
 Timestamp:
 Jun 5, 2012, 10:37:59 PM (7 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/source/level0/l0float.lisp
r14670 r15407 849 849 850 850 851 851 852 852 (defun sqrt (x &aux a b) 853 853 "Return the square root of NUMBER." 854 854 (cond ((zerop x) x) 855 ((complexp x) (* (sqrt (abs x)) (cis (/ (phase x) 2)))) 855 ((complexp x) 856 (let* ((i (imagpart x))) 857 (if (zerop i) ; has to be a float 858 (let* ((zero (if (typep i 'doublefloat) 0.0d0 0.0f0)) 859 (r (realpart x))) 860 (if (< r zero) 861 (%makecomplex zero (floatsign i (sqrt ( r)))) 862 (%makecomplex (abs (sqrt r)) (floatsign i zero)))) 863 (* (sqrt (abs x)) (cis (/ (phase x) 2)))))) 856 864 ((minusp x) (complex 0 (sqrt ( x)))) 857 865 ((floatp x)
Note: See TracChangeset
for help on using the changeset viewer.