Skip to content

Commit

Permalink
rationalize factor specfications before converting them into doubles
Browse files Browse the repository at this point in the history
  • Loading branch information
cddr committed Sep 20, 2010
1 parent bfb4f65 commit 6459fb6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unit-class.lisp
Expand Up @@ -28,7 +28,7 @@
(defmethod initialize-instance :after ((unit unit) &rest initargs)
(declare (ignore initargs))
(when (typep (factor-of unit) 'single-float)
(setf (factor-of unit) (float (factor-of unit) 0d0))))
(setf (factor-of unit) (float (rationalize (factor-of unit)) 0d0))))

(defmethod print-object ((unit unit) stream)
(print-unreadable-object (unit stream :type t :identity nil)
Expand Down

0 comments on commit 6459fb6

Please sign in to comment.