From bcd16840da9b108ed788b964168fb5ce34d097e2 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 20 Mar 2021 12:27:50 -0600 Subject: [PATCH] docs: note in `flsingle` about its use for single-precision operations Add some reassurance that `flsingle` can be used to implement single-precision arithmetic. --- pkgs/racket-doc/scribblings/reference/flonums.scrbl | 9 +++++++++ pkgs/racket-doc/scribblings/reference/reference.scrbl | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/pkgs/racket-doc/scribblings/reference/flonums.scrbl b/pkgs/racket-doc/scribblings/reference/flonums.scrbl index eec5af4bf5..862ab7d384 100644 --- a/pkgs/racket-doc/scribblings/reference/flonums.scrbl +++ b/pkgs/racket-doc/scribblings/reference/flonums.scrbl @@ -69,6 +69,15 @@ and range so that the result can be represented as a single-precision IEEE floating-point number (even if @tech{single-flonums} are not supported). +Using @racket[flsingle] on the arguments and results of @racket[fl+], +@racket[fl-], @racket[fl*], @racket[fl/], and @racket[flsqrt]---that +is, performing double-precision operations on values representable in +single precision and then rounding the result to single precision---is +always the same as performing the corresponding single-precision +operation @cite{Roux14}. (For other operations, the IEEE +floating-point specification does not make enough guarantees to say +more about the interaction with @racket[flsingle].) + @history[#:added "7.8.0.7"]} diff --git a/pkgs/racket-doc/scribblings/reference/reference.scrbl b/pkgs/racket-doc/scribblings/reference/reference.scrbl index e98cad657a..9733173429 100644 --- a/pkgs/racket-doc/scribblings/reference/reference.scrbl +++ b/pkgs/racket-doc/scribblings/reference/reference.scrbl @@ -209,6 +209,12 @@ The @racketmodname[racket] library combines #:url "https://doi.org/10.1017/CBO9780511574962" #:date "1999") + (bib-entry #:key "Roux14" + #:author "Pierre Roux" + #:title "Innocuous Double Rounding of Basic Arithmetic Operations" + #:location @elem{@italic{Journal of Formalized Reasoning}, 7(1)} + #:date "2014") + (bib-entry #:key "Sapin18" #:author "Simon Sapin" #:title "The WTF-8 Encoding"