Commit af6d4737 authored by lhealy's avatar lhealy
Browse files

Accept T for ieee754 argument to mean the type of the float number

given.


git-svn-id: svn+ssh://common-lisp.net/project/gsll/svn/trunk@50 af03a46b-e846-0410-96e5-d5653c316fd0
parent bbf998de
;; Comparison of floating point numbers using sequence integers ;; Comparison of floating point numbers using sequence integers
;; Liam Healy 2008-01-22 19:00:17EST floating-point.lisp ;; Liam Healy 2008-01-22 19:00:17EST floating-point.lisp
;; Time-stamp: <2008-03-21 15:04:15EDT floating-point.lisp> ;; Time-stamp: <2008-04-04 11:35:20EDT floating-point.lisp>
;; $Id$ ;; $Id$
;;; All floats can be represented by integers. There are two slightly ;;; All floats can be represented by integers. There are two slightly
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
(multiple-value-bind (mant exp sign sigbits expbits) (multiple-value-bind (mant exp sign sigbits expbits)
(decode-ieee754 float) (decode-ieee754 float)
(declare (ignore expbits)) (declare (ignore expbits))
(when (eq ieee754 t) (setf ieee754 (type-of float)))
(if ieee754 (if ieee754
(* (dpb 1 (ieee754-sign-bit ieee754) (+ (ash exp sigbits) mant))) (* (dpb 1 (ieee754-sign-bit ieee754) (+ (ash exp sigbits) mant)))
(* sign (+ (ash exp sigbits) mant))))) (* sign (+ (ash exp sigbits) mant)))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment