News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Large Floating Point Numbers

Started by cman, October 30, 2007, 07:46:50 PM

Previous topic - Next topic

cman

Are large floating point numbers ( beyond what the fpu can handle ) represented the same way they are in HLLs ( an array of bytes with a byte for each digit in the large floating point number ) ? Is there a different strategy used in assembly language? Thanks for any input. :U

raymond

QuoteAre large floating point numbers ( beyond what the fpu can handle )

All depends on your interpretation of large floating point numbers. A REAL10 gives you a range up to approximately 104932 which is quite a large number. However, the precision of even a REAL10 cannot exceed approximately 19 significant digits. So, if you have a number such as:
12345678901234567890123456789012345678901234567890
it is well within the range of a REAL10 (and even of a REAL8) but it could be rounded to something like
1.23456789012345679E+49 in scientific notation with the last 30 or so digits being lost.

If the number is really beyond what the FPU can handle (up to 1038 for REAL4, up to 10308 for REAL8), the number simply becomes the representation for INFINITY.

If you are interested in learning more about the floating point format, you may start by having a look at the following:
http://www.ray.masmcode.com/tutorial/fpuchap2.htm#floats

If you are talking about BIGNUM libraries available with some HLLs, that is a totally different subject not readily available in assembly.

Raymond
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com