Opened 3 weeks ago

#19040 new bug

strtold maps denormalized numbers to zero

Reported by: bhaible Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: System/libroot.so Version: R1/beta5
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

The strtold function is specified by POSIX at https://pubs.opengroup.org/onlinepubs/9799919799/functions/strtold.html . On x86_64 CPUs, 'long double' is "Extended Precision" https://en.wikipedia.org/wiki/Extended_precision#x86_extended_precision_format . Denormalized numbers are supported in this floating-point type. The strtold function should be able to parse them.

This does not work in Haiku hrev57823 (from 2024-07-15). It returns zero instead of a denormalized number.

How to reproduce: Compile and run the attached program.

gcc -Wall foo.c
./a.out

Expected output (like on glibc):

sizeof (long double) = 16
OK

Actual output:

sizeof (long double) = 16
a.out: foo.c:23:main: 0.0L < result
Kill Thread

Attachments (1)

foo.c (652 bytes ) - added by bhaible 3 weeks ago.
test case foo.c

Download all attachments as: .zip

Change History (1)

by bhaible, 3 weeks ago

Attachment: foo.c added

test case foo.c

Note: See TracTickets for help on using tickets.