@(author+email @tt{M. Douglas Williams} "doug@cognidrome.org")
@author[(author+email "M. Douglas Williams" "doug@cognidrome.org")]
This library provides functions to describe Racket objects. Currently, the following types of objects are described:
@margin-note{This is not the official version of Describe. It is the 1.5 version from PLaneT, retooled to use Racket's new package system, and with bigfloat support disabled (because of bugs related to v.5.3.x compatability.) The canonical version of Describe is on the @link["http://planet.racket-lang.org/display.ss?package=describe.plt&owner=williams" "PLaneT server"]. — MB}
@itemize{
@item{Booleans}
@item{Numbers}
@ -78,11 +80,8 @@ Examples:
@scheme[(integer->string (expt 10 150))] -> "at least 10^102"
Returns a string with the exact decimal value of the floating-point number @scheme[x]. This works for single precision, double precision, extended precision, and big floating-point values. Note that internally @scheme[x] is converted to an exact rational number as part of converting to a string and the following warning from the Arbitrary-Precision Floating-Point Numbers (Bigfloats) section in the Math Library is important.
@bold{Be careful with exact conversions.} Bigfloats with large exponents may not fit in memory as integers or exact rationals. Worse, they might fit, but have all your RAM and swap space for lunch.
Returns a string with the exact decimal value of the floating-point number @scheme[x]. This works for single precision, double precision, and extended precision values. Note that internally @scheme[x] is converted to an exact rational number as part of converting to a string.}
Prints a description of @scheme[x] to the current output port.}
@ -169,9 +166,6 @@ racket
(describe (sqrt -10))
(describe (+ (sqrt 10) (sqrt -10)))
(describe (bf 1/10))
(describe (bf "15e200000000"))
;;; Strings
(printf "~n--- Strings ---~n")
@ -344,8 +338,6 @@ Produces the following output.
3.1622776601683795 is an inexact positive real number whose exact decimal value is 3.162277660168379522787063251598738133907318115234375
0+3.1622776601683795i is an inexact positive imaginary number whose exact decimal value is 0+3.162277660168379522787063251598738133907318115234375i
3.1622776601683795+3.1622776601683795i is an inexact complex number whose real part 3.1622776601683795 is an inexact positive real number whose exact decimal value is 3.162277660168379522787063251598738133907318115234375 and whose imaginary part 0+3.1622776601683795i is an inexact positive imaginary number whose exact decimal value is 0+3.162277660168379522787063251598738133907318115234375i
(bf #e0.1000000000000000000000000000000000000001) is a positive big float with 128 bits of precision
(bf "1.499999999999999999999999999999999999998e200000001") is a positive big float with 128 bits of precision