Re: Layout floating point numbers

cbmnut_at_hushmail.com
Date: 2002-10-04 20:41:55

Hi Ruud,
the extra byte for sign is probably used temporarily when some routines unpack it.. for example in int conversions or comparisons.
Floating point is stored as a number between 1 and 2 to a power of 2, but since this number always starts with a 1 bit they just drop the leading bit.
There's other ways to store floating point numbers, both faster ways and more accurate ways.  The basic routines are pretty efficient however, at least the core routines.
Try looking for articles on ieee floating point and you can probably find some descriptions.  They have extra modes and values, for storing not a number (like 1/0), +- infinitiy and 1/inf (or +-0 so to speak), and can be unnormalized to extend the range.  They can round up down or chop.  And the routines must be accurate to certain limits.  They can also cause special errors besides division by zero.
Apple used SANE which used to have faster code in 68000 assembly.  Other 8 bit computers use pretty similar formats but different sizes.




Get your free encrypted email at https://www.hushmail.com

       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail 2.1.4.