Skip to content

Commit

Permalink
math: Avoid creating new bignums
Browse files Browse the repository at this point in the history
  • Loading branch information
yitzchak committed Jun 18, 2024
1 parent 96817d0 commit 5ba3cd3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions code/math/implementation.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
(defun round-to-odd/32 (g cp)
(let ((p (* g cp)))
(logior (ldb (byte 32 64) p)
(if (> (ldb (byte 32 32) p) 1) 1 0))))
(if (> p #x1FFFFFFFF) 1 0))))

(defun round-to-odd/64 (g cp)
(let ((p (* g cp)))
(logior (ldb (byte 64 128) p)
(if (> (ldb (byte 64 64) p) 1) 1 0))))
(if (> p #x1FFFFFFFFFFFFFFFF) 1 0))))

(defun round-to-odd/128 (g cp)
(let ((p (* g cp)))
(logior (ldb (byte 128 256) p)
(if (> (ldb (byte 128 128) p) 1) 1 0))))
(if (> p #x1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) 1 0))))

(defconstant +expt10/min-exponent/32+ -31)

Expand Down

0 comments on commit 5ba3cd3

Please sign in to comment.