[Cryptography] floating point

Henry Baker hbaker1 at pipeline.com
Sat Dec 27 13:26:21 EST 2014


At 12:30 PM 12/24/2014, Ray Dillinger wrote:
>One implementation of common lisp has bignum integers by
>request, and otherwise their numbers have numerator and
>denominator both of up to 64 bits, plus binary and decimal
>exponents, both of up to 32 bits.  Oh, and it gets yet
>weirder because if the denominator is negative, that signifies
>that the number is inexact (ie, rounding errors or inexact
>functions such as logarithm have been used in obtaining it)
>and that instead of the rational interpretation, the value
>of the other 63 bits of the denominator should be read as
>extending the numerator.
>
>It's all very clever, high precision, and gives exact results
>for a lot more of the cases where people expect them, but the
>prospect of doing numerical analysis and determining error
>bounds in that environment gives me hives.

"Common Lisp" requires true bignum arithmetic, otherwise
it isn't "Common Lisp".  I'm not quite sure which
common lisp you're referring to, but you might be
referring to "immediate" numbers (often called "fixnums"),
which don't require consing.  On some implementations,
declaring something as a "fixnum" together with
optimizing for speed and lack of "safety" will result
in code which can _only_ handle immediate fixnums, and
will produce undefined results -- including crashing --
if non-fixnums are provided.



More information about the cryptography mailing list