srfi.270 - Hexadecimal floating-point constants ¶Gauche’s built-in procedures understand hexadecimal floating-point consntants:
(string->number "#x1.fp-1") ⇒ 0.96875 (string->number "1.fp-1" 16) ⇒ 0.96875 (number->string 3.14 16) ⇒ "1.91eb851eb851fp1"
See Numeric literal syntax, for the details.
This module exports one auxiliary procedure defined in srfi-270.
[SRFI-270]{srfi.270}
First, z is converted to an inexact number, then
it is written out using hexadecimal floating-poit number notation
to the given port, or the current output port is port is omitted.
#x or #e) is written
0.0 or -0.0, it is printed with
a zero exponent, e.g. 0.0p0 or -0.0p0.
1.”.
0.”.
+nan.0 etc.
(write-hexadecimal-float 6.02e23) ⇒ 1.fde9f10a8d361p78 (write-hexadecimal-float 1e-310) ⇒ 0.93445b873158p-1029