Bug 42991
Summary: | libm routines give erroneous results | ||||||
---|---|---|---|---|---|---|---|
Product: | [Retired] Red Hat Raw Hide | Reporter: | Need Real Name <smeds> | ||||
Component: | glibc | Assignee: | Jakub Jelinek <jakub> | ||||
Status: | CLOSED NOTABUG | QA Contact: | Aaron Brown <abrown> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 1.0 | CC: | fweimer | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | i386 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2001-05-31 04:59:44 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Need Real Name
2001-05-31 04:58:38 UTC
Created attachment 20010 [details]
Source code example of libm problems
glibc has not been compiled with -ffast-math. The problem is elsewhere, I'd suggest you compile your programs with -Wall. The thing is that tgamma function is part of C99 standard only, which is a feature set you don't get by default (glibc headers attempt to be namespace clean). To select C99 standard feature set you can use e.g. -std=c99, but then the program will not work either, since ISO C99 does not define signgam variable. You can use e.g. -D_GNU_SOURCE which will include all non-deprecated non-conflicting feature sets, so you'll get both signgam and tgamma prototype. The program above misbehaves simply because with the options you gave to gcc there was no prototype for tgamma function, so it was assumed to be int tgamma(); |