Skip to content
Snippets Groups Projects
Commit fb26edf5 authored by ram's avatar ram
Browse files

Fixed up DUMP-FLOAT to make 0d0 be dumped so that it will be loaded as a double

float.
parent 8167b21f
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman (FAHLMAN@CMUC). ;;; Scott Fahlman (FAHLMAN@CMUC).
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/dump.lisp,v 1.10 1990/06/26 06:27:44 wlott Exp $ ;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/dump.lisp,v 1.11 1990/07/10 10:23:07 ram Exp $
;;; ;;;
;;; This file contains stuff that knows about dumping FASL files. ;;; This file contains stuff that knows about dumping FASL files.
;;; ;;;
...@@ -748,17 +748,20 @@ ...@@ -748,17 +748,20 @@
;;; Compute how many bytes it will take to represent signed integer N. ;;; Compute how many bytes it will take to represent signed integer N.
(defun compute-bytes (n) (defun compute-bytes (n)
(truncate (+ (integer-length n) 8) 8)) (ceiling (1+ (integer-length n)) 8))
(defun dump-float (x file) (defun dump-float (x file)
(multiple-value-bind (f exponent sign) (decode-float x) (let ((digits (float-digits x)))
(let ((mantissa (truncate (scale-float (* f sign) (float-precision f))))) (multiple-value-bind (sig exp sign)
(dump-fop 'lisp::fop-float file) (integer-decode-float x)
(dump-byte (1+ (integer-length exponent)) file) (let ((significand (* sig #-new-compiler (truncate sign)
(quick-dump-number exponent (compute-bytes exponent) file) #+new-compiler sign)) ;### i-d-f bug.
(dump-byte (1+ (integer-length mantissa)) file) (exponent (+ exp digits)))
(quick-dump-number mantissa (compute-bytes mantissa) file)))) (dump-fop 'lisp::fop-float file)
(dump-byte (1+ (integer-length exponent)) file)
(quick-dump-number exponent (compute-bytes exponent) file)
(dump-byte (1+ digits) file)
(quick-dump-number significand (ceiling (1+ digits) 8) file)))))
;;;; Symbol Dumping: ;;;; Symbol Dumping:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment