4.3.5 Extflonums

4.3 Numbers
4.3.1 Number Types
4.3.3 Flonums
4.3.4 Fixnums
4.3.5 Extflonums
4.3.5 Extflonums
On this page:
top
up

4.3.5ExtflonumsπŸ”— i

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 values for infinity are +inf.t and -inf.t. The extflonum value for not-a-number is +nan.t or -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? along the same lines as flonums: when they are extfl= and have the same sign (which matters for -0.0t0 and +0.0t0), or when they are both +nan.t. If extflonums are not supported on a platform, extflonums are equal? only if they are eq? .

procedure

( extflonum? v)boolean?

v:any/c
Returns #t if v is an extflonum, #f otherwise.

Returns #t if extflonum operations are supported on the current platform, #f otherwise.

4.3.5.1Extflonum ArithmeticπŸ”— i

procedure

( extfl+ ab)extflonum?

procedure

( extfl- ab)extflonum?

procedure

( extfl* ab)extflonum?

procedure

( extfl/ ab)extflonum?

procedure

( extflabs a)extflonum?

Like fl+ , fl- , fl* , fl/ , and flabs , but for extflonums.

procedure

( extfl= ab)boolean?

procedure

( extfl< ab)boolean?

procedure

( extfl> ab)boolean?

procedure

( extfl<= ab)boolean?

procedure

( extfl>= ab)boolean?

procedure

( extflmin ab)extflonum?

procedure

( extflmax ab)extflonum?

Like fl= , fl< , fl> , fl<= , fl>= , flmin , and flmax , but for extflonums.

procedure

( extflround a)extflonum?

procedure

( extflfloor a)extflonum?

procedure

( extflceiling a)extflonum?

procedure

( extfltruncate a)extflonum?

Like flround , flfloor , flceiling , and fltruncate , but for extflonums.

procedure

( extflsin a)extflonum?

procedure

( extflcos a)extflonum?

procedure

( extfltan a)extflonum?

procedure

( extflasin a)extflonum?

procedure

( extflacos a)extflonum?

procedure

( extflatan a)extflonum?

procedure

( extfllog a)extflonum?

procedure

( extflexp a)extflonum?

procedure

( extflsqrt a)extflonum?

procedure

( extflexpt ab)extflonum?

Like flsin , flcos , fltan , flasin , flacos , flatan , fllog , flexp , and flsqrt , and flexpt , but for extflonums.

procedure

( ->extfl a)extflonum?

procedure

( real->extfl a)extflonum?

a:real?

procedure

( extfl->exact a)(and/c real? exact? )

procedure

( extfl->fx a)fixnum?

procedure

( fx->extfl a)extflonum?

procedure

( extfl->inexact a)flonum?

The first six are like ->fl , fl->exact-integer , real->double-flonum , inexact->exact , fl->fx , and fx->fl , but for extflonums. The extfl->inexact function converts a extflonum to its closest flonum approximation.

Changed in version 7.7.0.8 of package base: Changed extfl->fx to truncate.

4.3.5.2Extflonum ConstantsπŸ”— i

value

pi.t :extflonum?

Like pi , but with 80 bits precision.

4.3.5.3Extflonum VectorsπŸ”— i

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

( in-extflvector vec[startstopstep])sequence?

stop:(or/c exact-integer? #f)=#f

syntax

( for/extflvector maybe-length(for-clause...)body...)

syntax

( for*/extflvector maybe-length(for-clause...)body...)

maybe-length =
| #:lengthlength-expr
| #:lengthlength-expr#:fillfill-expr
fill-expr : extflonum?

4.3.5.4Extflonum Byte StringsπŸ”— i

procedure

[ big-endian?
start
end])extflonum?
bstr:bytes?
big-endian?:any/c =(system-big-endian? )
Like floating-point-bytes->real , but for extflonums: Converts the extended-precision floating-point number encoded in bstr from position start (inclusive) to end (exclusive) to an extflonum. The difference between start an end must be 10 bytes.

procedure

[ big-endian?
dest-bstr
start])bytes?
big-endian?:any/c =(system-big-endian? )
dest-bstr : (and/c bytes? (not/c immutable? ))
= (make-bytes 10)
Like real->floating-point-bytes , but for extflonums: Converts x to its representation in a byte string of length 10.

top
up

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /