Here is a small program that demonstrates the error when compiled and executed:
Code: Select all
#include <proto/exec.h>
#include <proto/dos.h>
#include <math.h>
#include <stdio.h>
int main()
{
float x = 0.9;
float y = -0.9;
int a = 0;
int b = 0;
a = lroundf(x);
b = lroundf(y);
printf("x = %f & a = %d\n", x, a);
printf("y = %f & b = %d\n", y, b);
return 0;
}
6.Ram_Disk:> test
x = 0.900000 & a = 0
y = -0.900000 & b =0
The output when the above program (named 'test') is compiled with clib2 & executed:
6.Ram_Disk:> test
x = 0.900000 & a = 1
y = -0.900000 & b = -1
Can someone compile & test the above program, confirm the erronious result and file a bug report to get this fixed.