[Cryptography] floating point
Henry Baker
hbaker1 at pipeline.com
Sat Dec 27 14:06:18 EST 2014
At 10:15 AM 12/27/2014, Jerry Leichter wrote:
>There was a long thread on exactly this topic on this list not long ago. I forget the exact details, but the question was whether a C compiler was allowed to "optimize away" an overflow "present in the source" (in quotes since the standards specifically said that the overflow causes "undefined behavior", so "present in the source" is a statement that's tricky to make in the model presented by the standard).
Ada compilers are required to utilize "infinite precision arithmetic" when evaluating constant expressions -- those which the compiler can evaluate by itself at compile time. This feature is really nice when trying to come up with a human-readable versions of some numeric constants.
(Of course, Common Lisp allows the "#." notation to compute compile-time constants and the "#," notation to compute load-time constants; Common Lisp already enables bignums & rational numbers for "exact" arithmetic.)
I think that the original IBM IBSYS assemblers used to do the same thing for "assemble time" arithmetic expressions; I think that these were also evaluated in multiple precision arithmetic. IBM needed this capability to make sure that the "constants" that were computed for library routines would be correct.
More information about the cryptography
mailing list