(let ((fp-env* ((ucode-primitive float-environment 0))))
((ucode-primitive set-float-environment 1) fp-env)
fp-env*)))))
- unspecific)
+ (initialize-flonum-infinities!))
(define (initialize-package!)
(reset-package!)
(define flo:-inf.0)
;;; ZERO can be eliminated after 9.3 is released. It works around
;;; overly-aggressive constant folding in SF and LIAR.
-(let ((zero (lambda () (identity-procedure 0.))))
- (if (flo:have-trap-enable/disable?)
- (begin
- (set! flo:nan.0
- (named-lambda (flo:nan.0)
- (flo:with-exceptions-untrapped (flo:exception:invalid-operation)
- (lambda ()
- (flo:/ 0. (zero))))))
- (set! flo:+inf.0
- (named-lambda (flo:+inf.0)
- (flo:with-exceptions-untrapped (flo:exception:divide-by-zero)
- (lambda ()
- (flo:/ +1. (zero))))))
- (set! flo:-inf.0
- (named-lambda (flo:-inf.0)
- (flo:with-exceptions-untrapped (flo:exception:divide-by-zero)
- (lambda ()
- (flo:/ -1. (zero))))))
- unspecific)
- ;; This works on macOS. YMMV.
- (begin
- (set! flo:nan.0 (named-lambda (flo:nan.0) (flo:/ 0. (zero))))
- (set! flo:+inf.0 (named-lambda (flo:+inf.0) (flo:/ +1. (zero))))
- (set! flo:-inf.0 (named-lambda (flo:-inf.0) (flo:/ -1. (zero))))
- unspecific)))
\ No newline at end of file
+(define (initialize-flonum-infinities!)
+ (let ((zero (lambda () (identity-procedure 0.))))
+ (if (flo:have-trap-enable/disable?)
+ (begin
+ (set! flo:nan.0
+ (named-lambda (flo:nan.0)
+ (flo:with-exceptions-untrapped (flo:exception:invalid-operation)
+ (lambda ()
+ (flo:/ 0. (zero))))))
+ (set! flo:+inf.0
+ (named-lambda (flo:+inf.0)
+ (flo:with-exceptions-untrapped (flo:exception:divide-by-zero)
+ (lambda ()
+ (flo:/ +1. (zero))))))
+ (set! flo:-inf.0
+ (named-lambda (flo:-inf.0)
+ (flo:with-exceptions-untrapped (flo:exception:divide-by-zero)
+ (lambda ()
+ (flo:/ -1. (zero))))))
+ unspecific)
+ ;; This works on macOS. YMMV.
+ (begin
+ (set! flo:nan.0 (named-lambda (flo:nan.0) (flo:/ 0. (zero))))
+ (set! flo:+inf.0 (named-lambda (flo:+inf.0) (flo:/ +1. (zero))))
+ (set! flo:-inf.0 (named-lambda (flo:-inf.0) (flo:/ -1. (zero))))
+ unspecific))))
\ No newline at end of file