1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00

1;3202;0cMerge remote-tracking branch 'origin/stable-2.0'

This commit is contained in:
Andy Wingo 2012-07-28 12:44:36 +02:00
commit e0f68f785d
2 changed files with 7 additions and 3 deletions

View file

@ -8906,7 +8906,8 @@ SCM_PRIMITIVE_GENERIC (scm_angle, "angle", 1, 0, 0,
}
else if (SCM_REALP (z))
{
if (SCM_REAL_VALUE (z) >= 0)
double x = SCM_REAL_VALUE (z);
if (x > 0.0 || double_is_non_negative_zero (x))
return flo0;
else
return scm_from_double (atan2 (0.0, -1.0));

View file

@ -4241,7 +4241,7 @@
(with-test-prefix "angle"
(define pi 3.14159265358979323846)
(define (almost= x y)
(> 0.01 (magnitude (- x y))))
(> 0.000001 (magnitude (- x y))))
(pass-if (documented? angle))
@ -4252,7 +4252,10 @@
(pass-if "bignum -ve" (almost= pi (angle (1- fixnum-min))))
(pass-if "flonum +ve" (= 0 (angle 1.5)))
(pass-if "flonum -ve" (almost= pi (angle -1.5))))
(pass-if "flonum -ve" (almost= pi (angle -1.5)))
(pass-if "signed zero +ve" (= 0 (angle 0.0)))
(pass-if "signed zero -ve" (almost= pi (angle -0.0))))
;;;
;;; inexact->exact