File tree Expand file tree Collapse file tree
math-lib/math/private/flonum Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212
1313(: flonum->bit-field (Flonum -> Natural))
1414(define (flonum->bit-field x)
15- (assert (integer-bytes->integer (real->floating-point-bytes x (ann 8 8 )) #f )
16- exact-nonnegative-integer?))
15+ (flbit-field x 0 64 ))
1716
1817(: bit-field->flonum (Integer -> Flonum))
1918(define (bit-field->flonum i)
3029
3130(: flonum->fields (Flonum -> (Values (U 0 1 ) Index Natural)))
3231(define (flonum->fields x)
33- (define n (flonum->bit-field x))
34- (values (if (zero? (bitwise-bit-field n 63 64 )) 0 1 )
35- (assert (bitwise-bit-field n 52 63 ) index?)
36- (bitwise-bit-field n 0 52 )))
32+ (values (if (zero? (flbit-field n 63 64 )) 0 1 )
33+ (assert (flbit-field n 52 63 ) index?)
34+ (flbit-field n 0 52 )))
3735
3836(: fields->flonum (Integer Integer Integer -> Flonum))
3937(define (fields->flonum s e m)
6664
6765(: flonum->ordinal (Flonum -> Integer))
6866(define (flonum->ordinal x)
69- (cond [(x . fl< . 0.0 ) (- (flonum->bit- field (fl- 0.0 x)))]
70- [else (flonum->bit- field (flabs x))])) ; abs for -0.0
67+ (cond [(x . fl< . 0.0 ) (- (flbit- field (fl- 0.0 x) 0 64 ))]
68+ [else (flbit- field (flabs x) 0 64 )])) ; abs for -0.0
7169
7270(: ordinal->flonum (Integer -> Flonum))
7371(define (ordinal->flonum i)
You can’t perform that action at this time.
0 commit comments