pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/41170: pkgsrc/x11/xplanet build fails on solaris (patch included)



The following reply was made to PR pkg/41170; it has been noted by GNATS.

From: Tim Zingelman <tez%netbsd.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: pkg/41170: pkgsrc/x11/xplanet build fails on solaris (patch 
        included)
Date: Wed, 8 Apr 2009 11:09:42 -0500

 After more research, it appears that the main use of signbit() is to
 detect the difference between 0.0 and -0.0 so the simple < 0 check
 fails to do what is needed.  See quick example code below.
 
 /* example use of signbit() and why < 0 is not equivalent */
 /* compile with: cc -std=c99 checkzero.c -o checkzero */
 #include <stdio.h>
 #include <iso/math_c99.h>
 int main()
 {
 double pos = 0.0;
 double neg = -0.0;
 
 if (pos < 0) printf("pos < 0\n");
 if (pos < 0.0) printf("pos < 0.0\n");
 if (neg < 0) printf("neg < 0\n");
 if (neg < 0.0) printf("neg < 0.0\n");
 
 if (pos > -0) printf("pos > -0\n");
 if (pos > -0.0) printf("pos > -0.0\n");
 if (neg > -0) printf("neg > -0\n");
 if (neg > -0.0) printf("neg > -0.0\n");
 
 if (signbit(pos)) printf("signbit(pos) is true\n");
 if (signbit(neg)) printf("signbit(neg) is true\n");
 }
 /* expected output is only: signbit(neg) is true */
 
 Given that xplanet apparently cares about the difference between 0.0
 and -0.0, I kinda doubt it works on a non IEEE 754 platform anyway.
 


Home | Main Index | Thread Index | Old Index