Thanks Brian. Patch checked in and s_lrint.c modified similiarly.
-- Jeff J.
Brian Dessent wrote:
Erik de Castro Lopo wrote:
$ gcc -Wall -O3 lrintf_test.c -o lrintf_test
$ ./lrintf_test.exe
lrintf_test ( .00) : ok
lrint_test ( .00) : ok
lrintf_test (3.000
Brian Dessent wrote:
> Linux uses glibc, Cygwin uses newlib. They're not the same thing.
OK.
> Glibc is highly optimized and tweaked, newlib is designed as a small and
> portable libc for embedded systems.
Is the target small source code size or small executable size?
If its small executable
Erik de Castro Lopo wrote:
> Err, what??
>
> On Linux, the lrintf() function is an inline function that reduces to
> a single asm instruction.
Linux uses glibc, Cygwin uses newlib. They're not the same thing.
Glibc is highly optimized and tweaked, newlib is designed as a small and
Brian Dessent wrote:
> Yes, this does in fact seem to be a bug in lrintf. A reduced testcase
> is:
>
> #include
> #include
>
> int main ()
> {
> float f = -8399916.0;
> printf ("f = %f, k = %ld\n", f, lrintf (f));
> }
>
> The value -8399916.0 in binary is
>
> 1 10010110 01011000
Erik de Castro Lopo wrote:
> $ gcc -Wall -O3 lrintf_test.c -o lrintf_test
> $ ./lrintf_test.exe
> lrintf_test ( .00) : ok
> lrint_test ( .00) : ok
> lrintf_test (3.00) :
>
> Line 70: float : Incorrect sample (#252 : -8399916.00 => 889181140).
Hi all,
I've got a little test program below. On Linux, it compiles
using:
gcc-3.4 -Wall -O3 -std=c99 lrintf_test.c -lm -o lrintf_test
and when run produces:
lrintf_test ( .00) : ok
lrint_test ( .00) : ok
lrintf_test (3.00) : ok
lrint_test (3.00
6 matches
Mail list logo