The math version of printf seems to have trouble with the 0x3f7fffff floating point value, which equlals to 0.999999940395355224609. Instead of 1.000000 it gets interpreted as 0.1000000, the decimal point ends up in the wrong place. If I build without -noixemul the printf ixemul.library shows the correct value. The floattest.c program I created to reproduce this:
#include <stdio.h>
typedef union
{
float f;
unsigned int i;
} fi;
int main(void)
{
volatile fi val;
val.i = 0x3f7fffff; // 0.999999940395355224609
printf("%f 0x%08x\n", val.f, val.i);
return 0;
}
It can be built with m68k-amigaos-gcc -O2 -noixemul -m68020 -m68881 -o floattest floattest.c -lm. This is the minimal example with the exe:
http://bszili.morphos.me/stuff/floattest.zip
The math version of printf seems to have trouble with the 0x3f7fffff floating point value, which equlals to 0.999999940395355224609. Instead of 1.000000 it gets interpreted as 0.1000000, the decimal point ends up in the wrong place. If I build without -noixemul the printf ixemul.library shows the correct value. The floattest.c program I created to reproduce this:
It can be built with
m68k-amigaos-gcc -O2 -noixemul -m68020 -m68881 -o floattest floattest.c -lm
. This is the minimal example with the exe: http://bszili.morphos.me/stuff/floattest.zip