View Single Post
Old 03 June 2019, 13:06   #11
Thomas Richter
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 295
Originally Posted by phx View Post
Didn't ANSI-C define that the IEEE Std 754 has to be used for floating point data representation?
Nope. ANSI-C doesn't have much to say about the nature of the floating point. There might be a couple of minimum requirements concerning the precision, but that is about it.
Originally Posted by phx View Post
I would guess that storing float variables as 8 bytes double precision causes a lot of problems here.
Who says that sizeof(float)=4 and sizeof(double)=8? ANSI-C only requires that double is at least as precise as float, hence, sizeof(float) == sizeof(double) is perfectly fine. In this particular case, on the Amiga, both are 8 bytes long. But both = 4 bytes long also works, as far as ANSI C is concerned.
Originally Posted by phx View Post
My current math model for vbcc's m68k-kick13 target is to use shared libraries for everything (as I did for the OS2+ target), but due to the lack of IEEE single precision support all "float" artihmetics are done by mathffp/mathtrans (converting IEEEsingle to FFP back and forth). Maybe I should better convert everything to IEEEdouble - but that might be slower.
Stay away from mathffp and mathtrans. They implement a quite lousy math model. mathieeesingbas isn't much slower, but sane. Ok, except for the strange choice of the rounding model, but that will be fixed.
Thomas Richter is offline  
Page generated in 0.04159 seconds with 11 queries