3.2.5 Extflonums
(require racket/extflonum) |
An extflonum is an extended-precision (80-bit) floating-point number. extflonum arithmetic is supported on platforms with extended-precision hardware and where the extflonum implementation does not conflict with normal double-precision arithmetic (i.e., on x86 and x86_64 platforms when Racket is compiled to use SSE instructions for floating-point operations, and on Windows when "longdouble.dll" is available).
A extflonum is not a number in the sense of number?. Only extflonum-specific operations such as extfl+ perform extflonum arithmetic.
A literal extflonum is written like an inexact number, but using an explicit t or T exponent marker (see Reading Extflonums). For example, 3.5t0 is an extflonum. The extflonum infinities and non-a-number values are +inf.t, -inf.t, and +nan.t.
If (extflonum-available?) produces #f, then all operations exported by racket/extflonum raise exn:fail:unsupported, except for extflonum?, extflonum-available?, and extflvector? (which always work). The reader (see The Reader) always accepts extflonum input; when extflonum operations are not supported, printing an extflonum from the reader uses its source notation (as opposed to normalizing the format).
Two extflonums are equal? if extfl= produces #t for the extflonums. If extflonums are not supported in a platform, extflonums are equal? only if they are eq?.
procedure
(extflonum? v) → boolean?
v : any/c
procedure
3.2.5.1 Extflonum Arithmetic
procedure
(extfl+ a b) → extflonum?
a : extflonum? b : extflonum?
procedure
(extfl- a b) → extflonum?
a : extflonum? b : extflonum?
procedure
(extfl* a b) → extflonum?
a : extflonum? b : extflonum?
procedure
(extfl/ a b) → extflonum?
a : extflonum? b : extflonum?
procedure
(extflabs a) → extflonum?
a : extflonum?
procedure
a : extflonum? b : extflonum?
procedure
a : extflonum? b : extflonum?
procedure
a : extflonum? b : extflonum?
procedure
a : extflonum? b : extflonum?
procedure
a : extflonum? b : extflonum?
procedure
(extflmin a b) → extflonum?
a : extflonum? b : extflonum?
procedure
(extflmax a b) → extflonum?
a : extflonum? b : extflonum?
procedure
(extflround a) → extflonum?
a : extflonum?
procedure
(extflfloor a) → extflonum?
a : extflonum?
procedure
(extflceiling a) → extflonum?
a : extflonum?
procedure
(extfltruncate a) → extflonum?
a : extflonum?
procedure
(extflsin a) → extflonum?
a : extflonum?
procedure
(extflcos a) → extflonum?
a : extflonum?
procedure
(extfltan a) → extflonum?
a : extflonum?
procedure
(extflasin a) → extflonum?
a : extflonum?
procedure
(extflacos a) → extflonum?
a : extflonum?
procedure
(extflatan a) → extflonum?
a : extflonum?
procedure
(extfllog a) → extflonum?
a : extflonum?
procedure
(extflexp a) → extflonum?
a : extflonum?
procedure
(extflsqrt a) → extflonum?
a : extflonum?
procedure
(extflexpt a b) → extflonum?
a : extflonum? b : extflonum?
procedure
(->extfl a) → extflonum?
a : exact-integer?
procedure
a : extflonum?
procedure
(real->extfl a) → extflonum?
a : real?
procedure
(extfl->exact a) → (and/c real? exact?)
a : real?
procedure
(extfl->inexact a) → flonum?
a : real?
3.2.5.2 Extflonum Vectors
An extflvector is like an flvector, but it holds only extflonums. See also Unsafe Extflonum Operations.
Two extflvectors are equal? if they have the same length, and if the values in corresponding slots of the extflvectors are equal?.
procedure
(extflvector? v) → boolean?
v : any/c
procedure
(extflvector x ...) → extflvector?
x : extflonum?
procedure
(make-extflvector size [x]) → extflvector?
size : exact-nonnegative-integer? x : extflonum? = 0.0
procedure
vec : extflvector?
procedure
(extflvector-ref vec pos) → extflonum?
vec : extflvector? pos : exact-nonnegative-integer?
procedure
(extflvector-set! vec pos x) → extflonum?
vec : extflvector? pos : exact-nonnegative-integer? x : extflonum?
procedure
(extflvector-copy vec [start end]) → extflvector?
vec : extflvector? start : exact-nonnegative-integer? = 0 end : exact-nonnegative-integer? = (vector-length v)
procedure
(in-extflvector vec [start stop step]) → sequence?
vec : extflvector? start : exact-nonnegative-integer? = 0 stop : (or/c exact-integer? #f) = #f step : (and/c exact-integer? (not/c zero?)) = 1
syntax
(for/extflvector maybe-length (for-clause ...) body ...)
syntax
(for*/extflvector maybe-length (for-clause ...) body ...)
maybe-length =
| #:length length-expr | #:length length-expr #:fill fill-expr
length-expr : exact-nonnegative-integer?
fill-expr : extflonum?
procedure
(make-shared-extflvector size [x]) → extflvector?
size : exact-nonnegative-integer? x : extflonum? = 0.0
3.2.5.3 Extflonum Byte Strings
procedure
(floating-point-bytes->extfl bstr [ big-endian? start end]) → extflonum? bstr : bytes? big-endian? : any/c = (system-big-endian?) start : exact-nonnegative-integer? = 0 end : exact-nonnegative-integer? = (bytes-length bstr)
procedure
(extfl->floating-point-bytes x [ big-endian? dest-bstr start]) → bytes? x : extflonum? big-endian? : any/c = (system-big-endian?)
dest-bstr : (and/c bytes? (not/c immutable?)) = (make-bytes 10) start : exact-nonnegative-integer? = 0