A coworker passed this site along to me.

I still do not understand how floating point works, but this sure does help visualize what I do not understand.

https://www.h-schmidt.net/FloatConverter/IEEE754.html

I still do not understand how floating point works, but this sure does help visualize what I do not understand.

https://www.h-schmidt.net/FloatConverter/IEEE754.html

Sean Patrick ConnerFloating point is just binary scientific notation, 2^e * mantissa, where the mantissa is between 1.0 and 1.9… (except in binary). The exponent portion of IEEE-754 is biased by an amount, probably to make it easier to implement (pull out the bits by rotation and masking, then subtracting the bias to get the -exp to +exp range).

I’ve also been playing around with floating point on the 6809 (and Coco) in assembly with my custom assembler (https://github.com/spc476/a09). The first article is about converting from IEEE-754 to Microsoft format (https://boston.conman.org/2024/02/28.1), and the second one is a speed comparison between the MC6839 (floating point library) and Microsoft BASIC (https://boston.conman.org/2024/03/01.1).

Sean Patrick ConnerFloating point is just a binary version of the scientific notion: 2^exp * mantissa, where the mantissa is between 1.0 and 1.9… (just in binary notation). The exponent portion is biased by an amount for storage. You isolate the exponent bits, rotate them down, then subtract the bias to get the actual exponent.

I’ve been playing around with floating point on the 6809 (and the Coco in particular) with a custom assembler (https://github.com/spc476/a09). I’ve written about converting from IEEE-754 to Microsoft BASIC (https://boston.conman.org/2024/02/28.1), and the speed of the MC6839 (IEEE-754 ROM routines) vs. Microsoft (https://boston.conman.org/2024/03/01.1).

Sean Patrick ConnerLet’s see … does a comment sans links get through?

Allen HuffmanPost authorLooks like comments with URLs get held for moderation, then I can approve.

Sean Patrick ConnerSigh. Okay. Let’s try again.

The floating point format is just a binary version of scientific notation, 2^exp * mantissa, where the mantissa is 1.0 to 1.9… (but in binary) and where the leading 1 is assumed but not stored (to get an extra bit of range). The only confusing bit is the exponent is stored biased by some value, probably to make it easier to extract it out—isolate the bits, then subtract the bias to get the actual exponent.

Sean Patrick ConnerOkay, now for the links that aren’t links. I’ve been playing around with floating point on the 6809/Coco using a custom assembler I wrote (github.com/spc476/a09). I wrote about converting IEEE-754 floating point to Microsoft BASIC format (boston.conman.org/2024/02/28.1) and the speed difference between the MC6839 (IEEE-754 ROM) and MS BASIC (boston.conman.org/2024/03/01.1). Microsoft BASIC was faster, which I found slightly surprising.