# New Ticket Created by  Joshua Hoblitt 
# Please include the string:  [perl #38060]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=38060 >


A quick demonstration of the issue:

--
#include <stdio.h>
#include <math.h>

int main ()
{
    printf("%f\n", atan2(0.0, 0.0));
    printf("%f\n", atan2(-0.0, -0.0));
}
--

--
$ gcc foo.c -lm
$ ./a.out
0.000000
0.000000
--

This is also documented in config/init/hints/solaris.pm:

    ################################################################
    # Parrot usually aims for IEEE-754 compliance.
    # For Solaris 8/Sun Workshop Pro 4, both
    #    atan2( 0.0, -0.0) and atan2(-0.0, -0.0)
    # return 0, when they should return +PI and -PI respectively.
    # For Sun's compilers, fix this with the -xlibmieee flag.
    # I don't know of an equivalent flag for gcc.
    # (Alternatively, and more generally, perhahs we should run an
    # ieee-conformance test and then call back into a hints-file trigger
    # to set platform-specific flags.
    #   A. Dougherty  7 March 2005
    # We don't know which compiler we're using till after the gccversion
    # test.


The question is, can we get atan2() to 'behave' with gcc or do we need
to provide our own implementation?

-J

--

Attachment: pgpgBxGh0ZiTj.pgp
Description: PGP signature

Reply via email to