Ultimate Amiga

Network Boards => AMOS Language Discussion => AMOS Factory => AMOS Forum => Topic started by: Mia on February 06, 2017, 05:01:26 PM

Title: Floating Point
Post by: Mia on February 06, 2017, 05:01:26 PM
single precision (4 bytes) AMOS floating point numbers are not IEEE 754 - without digging into the code, does anyone have a description of the format please?

specifically I'm converting 32bit float wav files - I'm doing the endian-ness changes, but the value returned is just incorrect as AMOS stores them in the so called "Fast Floating Point Format" - but I've been unable to find any references yet...

there is a nice hex/binary converter here:

http://babbage.cs.qc.cuny.edu/IEEE-754.old/32bit.html

any ideas?
Title: Re: Floating Point
Post by: SamuraiCrow on February 06, 2017, 06:23:23 PM
Motorola fast floating point is a format included in a pair of libraries with AmigaOS.  You need to include the Motorola name in your search query.
Title: Re: Floating Point
Post by: Mia on February 07, 2017, 05:33:55 PM
Awesome, yup found the conversion method in the OS  ;)

http://amigadev.elowar.com/read/ADCD_2.1/Includes_and_Autodocs_2._guide/node0278.html
Title: Re: Floating Point
Post by: Sidewinder on February 07, 2017, 05:54:16 PM
The FFP format is described in the RKM here:

http://amigadev.elowar.com/read/ADCD_2.1/Libraries_Manual_guide/node047D.html

Title: Re: Floating Point
Post by: Mia on February 07, 2017, 11:37:16 PM
and there's the full library specs on:

http://wiki.amigaos.net/wiki/Math_Libraries

I got it working, by loading D0 with a fake integer of the float data:
Dreg(0)=DATA
DATA=Lib Call(6,Lvo("SPFieee"))
Loke Varptr(FLOAT#), Leek(Varptr(DATA))

it's not too slow, I'm just so happy it's working now  8)