(applicator flo:- (flo:-inf.0) (flo:-inf.0)))
(define-invop-flag-test 'flonum-divide (applicator flo:/ 0. 0.)) ;(e)
(define-invop-trap-test 'flonum-divide (applicator flo:/ 0. 0.)) ;(e)
+(define-invop-flag-test 'flonum-divide ;(e)
+ (applicator (make-primitive-procedure 'flonum-divide) 0. 0.)
+ 'xerror)
+(define-invop-trap-test 'flonum-divide ;(e)
+ (applicator (make-primitive-procedure 'flonum-divide) 0. 0.)
+ 'xerror)
;; XXX remainder ;(f)
(define-invop-flag-test 'flonum-sqrt (applicator flo:sqrt -1.)) ;(g)
(define-invop-trap-test 'flonum-sqrt (applicator flo:sqrt -1.)) ;(g)
;; XXX Check sign of infinity.
(define-divbyzero-flag-test 'flonum-divide (applicator flo:/ 1. 0.))
(define-divbyzero-trap-test 'flonum-divide (applicator flo:/ 1. 0.))
+(define-divbyzero-flag-test 'flonum-divide
+ (applicator (make-primitive-procedure 'flonum-divide) 1. 0.)
+ 'xerror)
+(define-divbyzero-trap-test 'flonum-divide
+ (applicator (make-primitive-procedure 'flonum-divide) 1. 0.)
+ 'xerror)
(define-divbyzero-flag-test 'flonum-log (applicator flo:log 0.))
(define-divbyzero-trap-test 'flonum-log (applicator flo:log 0.))
;; For all the inputs, reciprocal is exact.
(assert-eqv (expt (/ 1 x) (- y)) x^y)
(assert-eqv (expt (* 2 x) (/ y 2)) x^y)
- (assert-eqv (expt (/ 1 (* 2 x)) (- (/ y 2))) x^y))))))
\ No newline at end of file
+ (assert-eqv (expt (/ 1 (* 2 x)) (- (/ y 2))) x^y))))))
+
+(define-enumerated-test 'atan2
+ (vector
+ (vector +0. -1. (+ (atan 0 -1)))
+ (vector -0. -1. (- (atan 0 -1)))
+ (vector +0. -0. (+ (atan 0 -1)))
+ (vector -0. -0. (- (atan 0 -1)))
+ (vector +0. +0. +0.)
+ (vector -0. +0. -0.)
+ (vector +0. +1. +0.)
+ (vector -0. +1. -0.))
+ (lambda (v)
+ (let ((y (vector-ref v 0))
+ (x (vector-ref v 1))
+ (theta (vector-ref v 2)))
+ (define (body)
+ (assert-eqv (atan y x) theta))
+ (if (and (= y 0) (= x 0))
+ ;; XXX expected failure
+ (assert-error body)
+ (body)))))
\ No newline at end of file