FLONUM_BINARY_OPERATION (-)
DEFINE_PRIMITIVE ("FLONUM-MULTIPLY", Prim_flonum_multiply, 2, 2, 0)
FLONUM_BINARY_OPERATION (*)
-
DEFINE_PRIMITIVE ("FLONUM-DIVIDE", Prim_flonum_divide, 2, 2, 0)
-{
- PRIMITIVE_HEADER (2);
- {
- double denominator = (arg_flonum (2));
- if (denominator == 0)
- error_bad_range_arg (2);
- FLONUM_RESULT ((arg_flonum (1)) / denominator);
- }
-}
+ FLONUM_BINARY_OPERATION (/)
DEFINE_PRIMITIVE ("FLONUM-MODULO", Prim_flonum_modulo, 2, 2, 0)
#ifdef HAVE_FMOD
{
double y = (arg_flonum (1));
double x = (arg_flonum (2));
- if ((x == 0) && (y == 0))
- error_bad_range_arg (2);
FLONUM_RESULT (atan2 (y, x));
}
}
(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)
+ (applicator (make-primitive-procedure 'flonum-divide) 0. 0.))
(define-invop-trap-test 'flonum-divide ;(e)
- (applicator (make-primitive-procedure 'flonum-divide) 0. 0.)
- 'xerror)
+ (applicator (make-primitive-procedure 'flonum-divide) 0. 0.))
;; 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)
(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)
+ (applicator (make-primitive-procedure 'flonum-divide) 1. 0.))
(define-divbyzero-trap-test 'flonum-divide
- (applicator (make-primitive-procedure 'flonum-divide) 1. 0.)
- 'xerror)
+ (applicator (make-primitive-procedure 'flonum-divide) 1. 0.))
(define-divbyzero-flag-test 'flonum-log (applicator flo:log 0.))
(define-divbyzero-trap-test 'flonum-log (applicator flo:log 0.))
(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
+ (assert-eqv (atan y x) theta))))
\ No newline at end of file