Skip to content

Commit 144a6dc

Browse files
bdeketsamth
authored andcommitted
matrix-(cos-)-angle: correctly check for infinity
1 parent affe515 commit 144a6dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

math-lib/math/private/matrix/matrix-basic.rkt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@
312312
(define matrix-cos-angle
313313
(let ()
314314
(define (mag² [x : Number]) (if (real? x) (sqr x) (+ (sqr (real-part x)) (sqr (imag-part x)))))
315-
(define (inf=>1 [x : Real]) : Flonum (if (eq? x +inf.0) 1. (if (eq? x -inf.0) -1. 0.)))
315+
(define (inf=>1 [x : Real]) : Flonum (if (eqv? x +inf.0) 1. (if (eqv? x -inf.0) -1. 0.)))
316316
(: cinf=>1 (case-> (-> Real Flonum)
317317
(-> Float-Complex Float-Complex)
318318
(-> Number Number)))
@@ -374,7 +374,7 @@
374374
(cond
375375
[(flonum? ca) (flacos ca)]
376376
[(real? ca)
377-
(if (eq? ca 1) 0 (flacos (fl ca)))]
377+
(if (eqv? ca 1) 0 (flacos (fl ca)))]
378378
[else (acos ca)]))
379379

380380
(: matrix-normalize

0 commit comments

Comments
 (0)