-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hallo Ralf,
On 27 Oct 2006, at 17:57, Ralf Wildenhues wrote:
int main (void)
{
- return fabs (b (3.1415 / 2.)) < 0.01 && fabs (sqrt (4.) - 2.) <
0.01;
+ /* The ! is to invert C true to shell true
+ * The function b should call our sin (that returns 0) and not
libm's
+ * (in the latter case, b returns approximately 1)
+ * the sqrt is to force linking against libm
+ * the variable four is to prevent most compiler optimizations
+ */
+ return !( fabs (b (3.1415 / 2.)) < 0.01 && fabs (sqrt (four) -
2.) < 0.01 );
}
Rather than `!', may I humbly suggest the self documenting alternative:
int main (void)
{
int status = EXIT_FAILURE;
if (fabs (b (3.1415 / 2.)) < 0.01 && fabs (sqrt (four) - 2.) <
0.01)
status = EXIT_SUCCESS;
return status;
}
Cheers,
Gary
- --
Gary V. Vaughan ())_. [EMAIL PROTECTED]
Research Scientist ( '/ http://blog.azazil.net
GNU Hacker / )= http://www.gnu.org/software/{libtool,m4}
Technical Author `(_~)_ http://sources.redhat.com/autobook
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
iD8DBQFFS8enFRMICSmD1gYRAloEAKCIsDAx/KoKjQwhj4p2YLZHb8Av7QCgstGv
gGs1gVO7lkFWfGWTm+B2uRE=
=e4L/
-----END PGP SIGNATURE-----
_______________________________________________
http://lists.gnu.org/mailman/listinfo/libtool