#18351 closed bug (fixed)

wrong value of FP_ILOGB0

Reported by: bhaible Owned by: nobody
Priority: normal Milestone: R1/beta5
Component: System/POSIX Version: R1/beta4
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

According to ISO C 23 § 7.12.6.8 (and likewise POSIX https://pubs.opengroup.org/onlinepubs/9699919799/functions/ilogb.html ) the value of ilogb(0.0) and ilogbl(0.0L) must be FP_ILOGB0.

Additionally, ISO C 23 § 7.12 paragraph 18 specifies that "The value of FP_ILOGB0 shall be either INT_MIN or -INT_MAX."

In Haiku r1beta4, this latter statement is not fulfilled.

How to reproduce:

$ gcc -Wall -ggdb foo.c
$ ./a.out

Expected output (such as on glibc):

-2147483648 -2147483648 -2147483648

Actual output:

2147483647 2147483647 2147483647
Abort

Attachments (1)

foo.c (570 bytes ) - added by bhaible 14 months ago.
test case

Download all attachments as: .zip

Change History (2)

by bhaible, 14 months ago

Attachment: foo.c added

test case

comment:1 by waddlesplash, 14 months ago

Milestone: UnscheduledR1/beta5
Resolution: fixed
Status: newclosed

Fixed in hrev56904.

Note: See TracTickets for help on using tickets.