Message108734
| Author |
mark.dickinson |
| Recipients |
drkirkby, mark.dickinson, skrah |
| Date |
2010年06月26日.17:11:33 |
| SpamBayes Score |
0.00025479117 |
| Marked as misclassified |
No |
| Message-id |
<1277572295.99.0.918043204738.issue9069@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Here's some minimal failing code.
// Compile with:
// gcc-4.4 -m64 -fno-inline -g -O3 copysign_bug.c -o copysign_bug
#include <math.h>
#include <stdio.h>
int copysign_bug(double x)
{
if (x && (x * 0.5 == x))
return 1;
if (copysign(1.0, x) < 0.0)
return 2;
else
return 3;
}
int main(void) {
double x;
x = -0.0;
printf("copysign_bug(%.17g) = %d\n", x, copysign_bug(x));
x = 0.0;
printf("copysign_bug(%.17g) = %d\n", x, copysign_bug(x));
return 0;
}
This produces the output:
copysign_bug(-0) = 3
copysign_bug(0) = 3
I would expecting to see:
copysign_bug(-0) = 2
copysign_bug(0) = 3
I've reported this at:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44683 |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2010年06月26日 17:11:36 | mark.dickinson | set | recipients:
+ mark.dickinson, skrah, drkirkby |
| 2010年06月26日 17:11:35 | mark.dickinson | set | messageid: <1277572295.99.0.918043204738.issue9069@psf.upfronthosting.co.za> |
| 2010年06月26日 17:11:34 | mark.dickinson | link | issue9069 messages |
| 2010年06月26日 17:11:33 | mark.dickinson | create |
|