[Git][cmucl/cmucl][issue-435-add-core-math-lisp-support] 5 commits: Fix #474: Add functions to print and parse C-style hex floats
Raymond Toy pushed to branch issue-435-add-core-math-lisp-support at cmucl / cmucl Commits: beb2c36e by Raymond Toy at 2026-02-25T08:24:17-08:00 Fix #474: Add functions to print and parse C-style hex floats - - - - - 1030fd9b by Raymond Toy at 2026-02-25T08:24:17-08:00 Merge branch 'issue-474-print-parse-hex-floats' into 'master' Fix #474: Add functions to print and parse C-style hex floats Closes #474 See merge request cmucl/cmucl!353 - - - - - 6fc9b12e by Raymond Toy at 2026-02-26T17:37:44-08:00 Address #435: Compile single-float core-math routines - - - - - a134fea0 by Raymond Toy at 2026-02-26T17:37:44-08:00 Merge branch 'issue-435-add-core-math-compile-code' into 'master' Address #435: Compile single-float core-math routines See merge request cmucl/cmucl!356 - - - - - e244f40e by Raymond Toy at 2026-02-26T19:41:17-08:00 Merge branch 'master' into issue-435-add-core-math-lisp-support - - - - - 9 changed files: - bin/run-ansi-tests.sh - src/code/exports.lisp - + src/code/ext-code.lisp - src/general-info/release-22a.md - src/i18n/locale/cmucl.pot - src/tools/worldcom.lisp - src/tools/worldload.lisp - + tests/extensions.lisp - tests/float.lisp Changes: ===================================== bin/run-ansi-tests.sh ===================================== @@ -36,7 +36,7 @@ shift $((OPTIND - 1)) # Use branch cmucl-expected-failures in general since this branch # generally has the list of expected failures. This is the branch to # use on cmucl master in general. -BRANCH=cmucl-expected-failures-etypecase.15 +BRANCH=cmucl-expected-failures set -x if [ -d ../ansi-test ]; then ===================================== src/code/exports.lisp ===================================== @@ -1368,7 +1368,13 @@ (:export "PACKAGE-LOCAL-NICKNAMES" "ADD-PACKAGE-LOCAL-NICKNAME" "REMOVE-PACKAGE-LOCAL-NICKNAME" - "PACKAGE-LOCALLY-NICKNAMED-BY-LIST")) + "PACKAGE-LOCALLY-NICKNAMED-BY-LIST") + ;; Printing and parsing of C-style hex floats + (:export "FLOAT-TO-HEX-STRING" + "WRITE-HEX-FLOAT" + "FORMAT-HEX-FLOAT" + "HEX-PARSE-ERROR" + "PARSE-HEX-FLOAT")) (defpackage "STREAM" (:import-from "SYSTEM" "LISP-STREAM") ===================================== src/code/ext-code.lisp ===================================== @@ -0,0 +1,184 @@ +;;; -*- Log: code.log; Package: Extensions -*- +;;; +;;; ********************************************************************** +;;; This code was written as part of the CMU Common Lisp project at +;;; Carnegie Mellon University, and has been placed in the public domain. +;;; +(ext:file-comment + "$Header: src/code/extensions.lisp $") +;;; +;;; +;;; ********************************************************************** +;;; +;;; Spice Lisp extensions to the language. +;;; +;;; These extensions are compiled natively instead of byte-compiled +;;; like the code in code/extensions.lisp. +;;; +;;; ********************************************************************** +(in-package "EXTENSIONS") + +(intl:textdomain "cmucl") + + +;;;; C-style hex float printer and parser + +;;; FLOAT-TO-HEX-STRING -- Public +;;; +;;; Return a string representing a single and double-floats in C-style +;;; hex format. +(defun float-to-hex-string (val &optional at-p) + "Prints a single or double float in bit-perfect C-style hex. + If AT-P is true, prepends '+' for non-negative finite values." + (cond ((ext:float-nan-p val) + "0x0.0p+nan") + ((ext:float-infinity-p val) + (if (plusp val) + (if at-p + "+0x1.0p+inf" "0x1.0p+inf") + "-0x1.0p+inf")) + (t + (multiple-value-bind (sign exp-bits mantissa bias precision suffix) + (typecase val + (single-float + (let ((bits (ldb (byte 32 0) (kernel:single-float-bits val)))) + (values (ldb (byte 1 31) bits) + (ldb (byte 8 23) bits) + (ash (ldb (byte 23 0) bits) 1) ; Align 23 to 6 hex digits + 127 6 "f"))) + (double-float + (multiple-value-bind (hi lo) (kernel:double-float-bits val) + (values (ldb (byte 1 31) hi) + (ldb (byte 11 20) hi) + (logior (ash (ldb (byte 20 0) hi) 32) (ldb (byte 32 0) lo)) + 1023 13 ""))) + (t (error "Unsupported float type: ~S" (type-of val)))) + + (let ((sign-str (cond ((= sign 1) "-") + (at-p "+") + (t "")))) + (if (and (zerop exp-bits) (zerop mantissa)) + (format nil "~A0x0.0p+0~A" sign-str suffix) + (format nil "~A0x~A.~V,'0Xp~A~A" + sign-str + (if (zerop exp-bits) "0" "1") + precision + mantissa + (if (zerop exp-bits) (1+ (- bias)) (- exp-bits bias)) + suffix))))))) + +;;; WRITE-HEX-FLOAT -- Public +;;; +;;; Writes a float number in C-style hex format to the given stream. +(defun write-hex-float (float &optional (stream *standard-output*)) + "Convert FLOAT to C-style hex string and write it to STREAM. + Infinities are printed as \"-inf\" and \"inf\". NaN is printed as + \"nan\"." + (declare (float float)) + (write-string (float-to-hex-string float) + stream)) + +;;; FORMAT-HEX-FLOAT -- Public +;;; +;;; Function that can be used in a FORMAT ~/ +(defun format-hex-float (stream arg colon-p at-sign-p &optional width) + "Formatter for ~/ext:format-hex-float/. + Uses AT-SIGN-P (@) to force the sign. COLON-P (:) is currently ignored." + (declare (ignore width colon-p)) + (write-string (float-to-hex-string arg at-sign-p) + stream)) + +(define-condition hex-parse-error (parse-error) + ((text :initarg :text :reader hex-parse-error-text) + (message :initarg :message :reader hex-parse-error-message)) + (:report (lambda (c s) + (format s "Hex float parse error in ~S: ~A" + (hex-parse-error-text c) (hex-parse-error-message c))))) + +;;; PARSE-HEX-FLOAT-FROM-STREAM -- Public +;;; +;;; Parse a C-style float hex string from a stream. Invalid formats +;;; signal an error. A single-float or double-float may be returned. +(defun parse-hex-float-from-stream (stream) + "Reads a C-style hex float number from STREAM. A single-float or + double-float number is returned. A HEX-PARSE-ERROR is signaled for + an invalid format." + (let* ((sign 1.0d0) + (char (peek-char t stream))) ; Skip whitespace + + ;; 1. Handle Sign + (when (member char '(#\+ #\-)) + (when (char= (read-char stream) #\-) (setf sign -1.0d0)) + (setf char (peek-char nil stream))) + + ;; 2. Verify '0x' Prefix + (unless (and (char-equal (read-char stream) #\0) + (char-equal (read-char stream) #\x)) + (error 'hex-parse-error :text "Stream" :message "Missing '0x' prefix")) + + ;; 3. Read Significand + (let ((val 0.0d0) + (digits-read 0)) + ;; Integer part loop + (loop for c = (peek-char nil stream nil nil) + for digit = (and c (digit-char-p c 16)) + while digit + do (read-char stream) + (setf val (+ (* val 16.0d0) digit)) + (incf digits-read)) + + ;; Fractional part loop + (when (eql (peek-char nil stream nil nil) #\.) + (read-char stream) ; Consume #\. + (loop with weight = (/ 1.0d0 16.0d0) + for c = (peek-char nil stream nil nil) + for digit = (and c (digit-char-p c 16)) + while digit + do (read-char stream) + (setf val (+ val (* digit weight))) + (setf weight (/ weight 16.0d0)) + (incf digits-read))) + + (unless (plusp digits-read) + (error 'hex-parse-error :text "Stream" :message "No hex digits in significand")) + + ;; 4. Handle Exponent 'p' + (let ((p-char (read-char stream nil))) + (unless (and p-char (char-equal p-char #\p)) + (error 'hex-parse-error :text "Stream" :message "Missing exponent 'p'")) + + ;; Size 6 handles sign + 3-4 digits + buffer + (let ((exp-str (make-array 6 :element-type 'character + :fill-pointer 0 + :adjustable t))) + (loop for c = (peek-char nil stream nil nil) + while (and c (find c "+-0123456789")) + do (vector-push-extend (read-char stream) exp-str)) + + (when (zerop (length exp-str)) + (error 'hex-parse-error :text "Stream" :message "Invalid or missing exponent")) + + (let* ((raw-exp (parse-integer exp-str)) + (suffix (peek-char nil stream nil #\Space)) + (is-single (char-equal suffix #\f)) + ;; Final Construction + (result (* sign (scale-float val raw-exp)))) + + (when is-single (read-char stream)) ; Consume 'f' + + (if is-single + (float result 1.0f0) + result))))))) + +;;; PARSE-HEX-FLOAT -- Public +;;; +;;; Parse a C-style hex float number from either a string or a stream. +(defun parse-hex-float (obj) + "Parse a C-style hex float number from OBJ which is either a string or a stream." + (declare (type (or string stream) obj)) + (etypecase obj + (string + (with-input-from-string (s obj) + (parse-hex-float-from-stream s))) + (stream + (parse-hex-float-from-stream obj)))) ===================================== src/general-info/release-22a.md ===================================== @@ -57,6 +57,7 @@ public domain. * #460: Unit tests were not being recognized as failing on CI. * #463: `double-double-float` is missing comparison operations between `double-double-float` and `double-float` + * #474: Add functions to print and parse C-style hex floats. * Other changes: * Improvements to the PCL implementation of CLOS: * Changes to building procedure: ===================================== src/i18n/locale/cmucl.pot ===================================== @@ -6060,6 +6060,38 @@ msgid "" " afterward." msgstr "" +#: src/code/ext-code.lisp +msgid "" +"Prints a single or double float in bit-perfect C-style hex.\n" +" If AT-P is true, prepends '+' for non-negative finite values." +msgstr "" + +#: src/code/ext-code.lisp +msgid "" +"Convert FLOAT to C-style hex string and write it to STREAM.\n" +" Infinities are printed as \"-inf\" and \"inf\". NaN is printed as\n" +" \"nan\"." +msgstr "" + +#: src/code/ext-code.lisp +msgid "" +"Formatter for ~/ext:format-hex-float/. \n" +" Uses AT-SIGN-P (@) to force the sign. COLON-P (:) is currently ignored." +msgstr "" + +#: src/code/ext-code.lisp +msgid "" +"Reads a C-style hex float number from STREAM. A single-float or\n" +" double-float number is returned. A HEX-PARSE-ERROR is signaled for\n" +" an invalid format." +msgstr "" + +#: src/code/ext-code.lisp +msgid "" +"Parse a C-style hex float number from OBJ which is either a string or a " +"stream." +msgstr "" + #: src/code/commandline.lisp msgid "A list of all the command line arguments after --" msgstr "" ===================================== src/tools/worldcom.lisp ===================================== @@ -221,6 +221,7 @@ (comf "target:code/misc") (comf "target:code/misc-doc") (comf "target:code/extensions" :byte-compile t) +(comf "target:code/ext-code") (comf "target:code/commandline") (comf "target:code/env-access") ===================================== src/tools/worldload.lisp ===================================== @@ -44,6 +44,7 @@ (maybe-byte-load "target:code/extensions") +(maybe-byte-load "target:code/ext-code") (maybe-byte-load "target:code/defmacro") (maybe-byte-load "target:code/sysmacs") ===================================== tests/extensions.lisp ===================================== @@ -0,0 +1,89 @@ +;; Test extensions +(defpackage :extensions-tests + (:use :cl :lisp-unit)) + +(in-package "EXTENSIONS-TESTS") + +(defun get-double-bits (val) + (multiple-value-bind (hi lo) (kernel:double-float-bits val) + (logior (ash (ldb (byte 32 0) hi) 32) (ldb (byte 32 0) lo)))) + +(defun get-single-bits (val) + (ldb (byte 32 0) (kernel:single-float-bits val))) + +(define-test test-hex-syntax + (:tag :validation) + (assert-error 'ext:hex-parse-error (ext:parse-hex-float "inf")) + (assert-error 'ext:hex-parse-error (ext:parse-hex-float "0x.p+0")) + (assert-error 'ext:hex-parse-error (ext:parse-hex-float "0x1.0p"))) + +(define-test test-cliff-boundaries + (:tag :precision) + ;; Double Precision (-1022 Cliff) + + (assert-equal #x0010000000000000 + (get-double-bits (ext:parse-hex-float "0x1.0000000000000p-1022"))) + (assert-equal #x000fffffffffffff + (get-double-bits (ext:parse-hex-float "0x0.fffffffffffffp-1022"))) + (assert-equal #x001f0195cb356b8f + (get-double-bits (ext:parse-hex-float "0x1.f0195cb356b8fp-1022"))) + + ;; Single Precision (-126 Cliff) + + (assert-equal #x00800000 + (get-single-bits (ext:parse-hex-float "0x1.000000p-126f"))) + (assert-equal #x00400000 + (get-single-bits (ext:parse-hex-float "0x0.800000p-126f"))) + (assert-equal #x7f7fffff + (get-single-bits (ext:parse-hex-float "0x1.fffffep+127f")))) + +(define-test test-negative-zero + (:tag :edge-cases) + (assert-equal #x8000000000000000 + (get-double-bits (ext:parse-hex-float "-0x0.0p+0"))) + (assert-equal #x80000000 + (get-single-bits (ext:parse-hex-float "-0x0.0p+0f"))) + (assert-true (typep (ext:parse-hex-float "-0x0.0p+0f") + 'single-float))) + +(define-test test-subnormal-boundaries + (:tag :edge) + ;; Test smallest single-float subnormal + (let* ((val (kernel:make-single-float 1)) + (str (ext:float-to-hex-string val)) + (parsed (ext:parse-hex-float str))) + (assert-equal (get-single-bits val) (get-single-bits parsed) + val str parsed)) + ;; Test smallest double-float subnormal + (let* ((val (kernel:make-double-float 0 1)) + (str (ext:float-to-hex-string val)) + (parsed (ext:parse-hex-float str))) + (assert-equal (get-double-bits val) (get-double-bits parsed) + val str parsed))) + +(define-test test-double-roundtrip + (:tag :stress) + (loop repeat 10000 do + (let* ((hi-bits (random #x100000000)) + (hi (if (logbitp 31 hi-bits) (- hi-bits #x100000000) hi-bits)) + (lo (random #x100000000)) + (val (kernel:make-double-float hi lo))) + (unless (or (ext:float-nan-p val) (ext:float-infinity-p val)) + (let* ((str (ext:float-to-hex-string val)) + (parsed (ext:parse-hex-float str))) + (assert-equal (get-double-bits val) + (get-double-bits parsed) + val str parsed)))))) + +(define-test test-single-roundtrip + (:tag :stress) + (loop repeat 10000 do + (let* ((bits-raw (random #x100000000)) + (bits (if (logbitp 31 bits-raw) (- bits-raw #x100000000) bits-raw)) + (val (kernel:make-single-float bits))) + (unless (or (ext:float-nan-p val) (ext:float-infinity-p val)) + (let* ((str (concatenate 'string (ext:float-to-hex-string val) "f")) + (parsed (ext:parse-hex-float str))) + (assert-equal (get-single-bits val) + (get-single-bits parsed) + val str parsed)))))) ===================================== tests/float.lisp ===================================== @@ -346,20 +346,7 @@ ;; Rudimentary code to read C %a formatted numbers that look like ;; "-0x1.c4dba4ba1ee79p-620". We assume STRING is exactly in this ;; format. No error-checking is done. -(defun parse-hex-float (string) - (let* ((sign (if (char= (aref string 0) #\-) - -1 - 1)) - (dot-posn (position #\. string)) - (p-posn (position #\p string)) - (lead (parse-integer string :start (1- dot-posn) :end dot-posn)) - (frac (parse-integer string :start (1+ dot-posn) :end p-posn :radix 16)) - (exp (parse-integer string :start (1+ p-posn)))) - (* sign - (scale-float (float (+ (ash lead 52) - frac) - 1d0) - (- exp 52))))) + ;; Relative error in terms of bits of accuracy. This is the ;; definition used by Baudin and Smith. A result of 53 means the two @@ -507,50 +494,50 @@ ;; 13 ;; Iteration 1. Without this, we would instead return ;; - ;; (complex (parse-hex-float "0x1.ba8df8075bceep+155") - ;; (parse-hex-float "-0x1.a4ad6329485f0p-895")) + ;; (complex (ext:parse-hex-float "0x1.ba8df8075bceep+155") + ;; (ext:parse-hex-float "-0x1.a4ad6329485f0p-895")) ;; ;; whose imaginary part is quite a bit off. (frob cdiv.mcgehearty-iteration.1 - (complex (parse-hex-float "0x1.73a3dac1d2f1fp+509") - (parse-hex-float "-0x1.c4dba4ba1ee79p-620")) - (complex (parse-hex-float "0x1.adf526c249cf0p+353") - (parse-hex-float "0x1.98b3fbc1677bbp-697")) - (complex (parse-hex-float "0x1.BA8DF8075BCEEp+155") - (parse-hex-float "-0x1.A4AD628DA5B74p-895")) + (complex (ext:parse-hex-float "0x1.73a3dac1d2f1fp+509") + (ext:parse-hex-float "-0x1.c4dba4ba1ee79p-620")) + (complex (ext:parse-hex-float "0x1.adf526c249cf0p+353") + (ext:parse-hex-float "0x1.98b3fbc1677bbp-697")) + (complex (ext:parse-hex-float "0x1.BA8DF8075BCEEp+155") + (ext:parse-hex-float "-0x1.A4AD628DA5B74p-895")) 53 106) ;; 14 ;; Iteration 2. (frob cdiv.mcgehearty-iteration.2 - (complex (parse-hex-float "-0x0.000000008e4f8p-1022") - (parse-hex-float "0x0.0000060366ba7p-1022")) - (complex (parse-hex-float "-0x1.605b467369526p-245") - (parse-hex-float "0x1.417bd33105808p-256")) - (complex (parse-hex-float "0x1.cde593daa4ffep-810") - (parse-hex-float "-0x1.179b9a63df6d3p-799")) + (complex (ext:parse-hex-float "-0x0.000000008e4f8p-1022") + (ext:parse-hex-float "0x0.0000060366ba7p-1022")) + (complex (ext:parse-hex-float "-0x1.605b467369526p-245") + (ext:parse-hex-float "0x1.417bd33105808p-256")) + (complex (ext:parse-hex-float "0x1.cde593daa4ffep-810") + (ext:parse-hex-float "-0x1.179b9a63df6d3p-799")) 52 106) ;; 15 ;; Iteration 3 (frob cdiv.mcgehearty-iteration.3 - (complex (parse-hex-float "0x1.cb27eece7c585p-355 ") - (parse-hex-float "0x0.000000223b8a8p-1022")) - (complex (parse-hex-float "-0x1.74e7ed2b9189fp-22") - (parse-hex-float "0x1.3d80439e9a119p-731")) - (complex (parse-hex-float "-0x1.3b35ed806ae5ap-333") - (parse-hex-float "-0x0.05e01bcbfd9f6p-1022")) + (complex (ext:parse-hex-float "0x1.cb27eece7c585p-355 ") + (ext:parse-hex-float "0x0.000000223b8a8p-1022")) + (complex (ext:parse-hex-float "-0x1.74e7ed2b9189fp-22") + (ext:parse-hex-float "0x1.3d80439e9a119p-731")) + (complex (ext:parse-hex-float "-0x1.3b35ed806ae5ap-333") + (ext:parse-hex-float "-0x0.05e01bcbfd9f6p-1022")) 53 106) ;; 16 ;; Iteration 4 (frob cdiv.mcgehearty-iteration.4 - (complex (parse-hex-float "-0x1.f5c75c69829f0p-530") - (parse-hex-float "-0x1.e73b1fde6b909p+316")) - (complex (parse-hex-float "-0x1.ff96c3957742bp+1023") - (parse-hex-float "0x1.5bd78c9335899p+1021")) - (complex (parse-hex-float "-0x1.423c6ce00c73bp-710") - (parse-hex-float "0x1.d9edcf45bcb0ep-708")) + (complex (ext:parse-hex-float "-0x1.f5c75c69829f0p-530") + (ext:parse-hex-float "-0x1.e73b1fde6b909p+316")) + (complex (ext:parse-hex-float "-0x1.ff96c3957742bp+1023") + (ext:parse-hex-float "0x1.5bd78c9335899p+1021")) + (complex (ext:parse-hex-float "-0x1.423c6ce00c73bp-710") + (ext:parse-hex-float "0x1.d9edcf45bcb0ep-708")) 52 106)) @@ -592,26 +579,6 @@ (assert-equal -2w300 (* -2w300 1w0))) - - -;; Rudimentary code to read C %a formatted numbers that look like -;; "-0x1.c4dba4ba1ee79p-620". We assume STRING is exactly in this -;; format. No error-checking is done. -(defun parse-hex-float (string) - (let* ((sign (if (char= (aref string 0) #\-) - -1 - 1)) - (dot-posn (position #\. string)) - (p-posn (position #\p string)) - (lead (parse-integer string :start (1- dot-posn) :end dot-posn)) - (frac (parse-integer string :start (1+ dot-posn) :end p-posn :radix 16)) - (exp (parse-integer string :start (1+ p-posn)))) - (* sign - (scale-float (float (+ (ash lead 52) - frac) - 1d0) - (- exp 52))))) - ;; Relative error in terms of bits of accuracy. This is the ;; definition used by Baudin and Smith. A result of 53 means the two ;; numbers have identical bits. For complex numbers, we use the min @@ -725,47 +692,47 @@ ;; 13 ;; Iteration 1. Without this, we would instead return ;; - ;; (complex (parse-hex-float "0x1.ba8df8075bceep+155") - ;; (parse-hex-float "-0x1.a4ad6329485f0p-895")) + ;; (complex (ext:parse-hex-float "0x1.ba8df8075bceep+155") + ;; (ext:parse-hex-float "-0x1.a4ad6329485f0p-895")) ;; ;; whose imaginary part is quite a bit off. (frob cdiv.mcgehearty-iteration.1 - (complex (parse-hex-float "0x1.73a3dac1d2f1fp+509") - (parse-hex-float "-0x1.c4dba4ba1ee79p-620")) - (complex (parse-hex-float "0x1.adf526c249cf0p+353") - (parse-hex-float "0x1.98b3fbc1677bbp-697")) - (complex (parse-hex-float "0x1.BA8DF8075BCEEp+155") - (parse-hex-float "-0x1.A4AD628DA5B74p-895")) + (complex (ext:parse-hex-float "0x1.73a3dac1d2f1fp+509") + (ext:parse-hex-float "-0x1.c4dba4ba1ee79p-620")) + (complex (ext:parse-hex-float "0x1.adf526c249cf0p+353") + (ext:parse-hex-float "0x1.98b3fbc1677bbp-697")) + (complex (ext:parse-hex-float "0x1.BA8DF8075BCEEp+155") + (ext:parse-hex-float "-0x1.A4AD628DA5B74p-895")) 53) ;; 14 ;; Iteration 2. (frob cdiv.mcgehearty-iteration.2 - (complex (parse-hex-float "-0x0.000000008e4f8p-1022") - (parse-hex-float "0x0.0000060366ba7p-1022")) - (complex (parse-hex-float "-0x1.605b467369526p-245") - (parse-hex-float "0x1.417bd33105808p-256")) - (complex (parse-hex-float "0x1.cde593daa4ffep-810") - (parse-hex-float "-0x1.179b9a63df6d3p-799")) + (complex (ext:parse-hex-float "-0x0.000000008e4f8p-1022") + (ext:parse-hex-float "0x0.0000060366ba7p-1022")) + (complex (ext:parse-hex-float "-0x1.605b467369526p-245") + (ext:parse-hex-float "0x1.417bd33105808p-256")) + (complex (ext:parse-hex-float "0x1.cde593daa4ffep-810") + (ext:parse-hex-float "-0x1.179b9a63df6d3p-799")) 52) ;; 15 ;; Iteration 3 (frob cdiv.mcgehearty-iteration.3 - (complex (parse-hex-float "0x1.cb27eece7c585p-355 ") - (parse-hex-float "0x0.000000223b8a8p-1022")) - (complex (parse-hex-float "-0x1.74e7ed2b9189fp-22") - (parse-hex-float "0x1.3d80439e9a119p-731")) - (complex (parse-hex-float "-0x1.3b35ed806ae5ap-333") - (parse-hex-float "-0x0.05e01bcbfd9f6p-1022")) + (complex (ext:parse-hex-float "0x1.cb27eece7c585p-355 ") + (ext:parse-hex-float "0x0.000000223b8a8p-1022")) + (complex (ext:parse-hex-float "-0x1.74e7ed2b9189fp-22") + (ext:parse-hex-float "0x1.3d80439e9a119p-731")) + (complex (ext:parse-hex-float "-0x1.3b35ed806ae5ap-333") + (ext:parse-hex-float "-0x0.05e01bcbfd9f6p-1022")) 53) ;; 16 ;; Iteration 4 (frob cdiv.mcgehearty-iteration.4 - (complex (parse-hex-float "-0x1.f5c75c69829f0p-530") - (parse-hex-float "-0x1.e73b1fde6b909p+316")) - (complex (parse-hex-float "-0x1.ff96c3957742bp+1023") - (parse-hex-float "0x1.5bd78c9335899p+1021")) - (complex (parse-hex-float "-0x1.423c6ce00c73bp-710") - (parse-hex-float "0x1.d9edcf45bcb0ep-708")) + (complex (ext:parse-hex-float "-0x1.f5c75c69829f0p-530") + (ext:parse-hex-float "-0x1.e73b1fde6b909p+316")) + (complex (ext:parse-hex-float "-0x1.ff96c3957742bp+1023") + (ext:parse-hex-float "0x1.5bd78c9335899p+1021")) + (complex (ext:parse-hex-float "-0x1.423c6ce00c73bp-710") + (ext:parse-hex-float "0x1.d9edcf45bcb0ep-708")) 52)) (define-test complex-division.misc View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/e8f54c41a0d4bdd12949b2a... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/e8f54c41a0d4bdd12949b2a... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)