[Bug 1231263] slic3r-1.1.7-4.fc23 FTBFS with perl-5.22: 'W direction' t/angles.t test fails

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

 



https://bugzilla.redhat.com/show_bug.cgi?id=1231263

Miro Hrončok <mhroncok@xxxxxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED



--- Comment #2 from Miro Hrončok <mhroncok@xxxxxxxxxx> ---
The code that gets executed here is (simplified):

C++:
    #define PI 3.141592653589793238
    ...
    double atan2 = atan2(0-0,0-10);
    // note: atan2 is mathematically speaking an actual pi now
    return (atan2 == PI) ? 0
        : (atan2 < 0) ? (atan2 + PI)
        : atan2;

The routine returns 0 on x86_64 because the (atan2 == PI) condition passes.

On i686 it returns something else (3.14159265358979 ?) as the condition somehow
doesn't pass.



But when I take the failing test:

    is line_direction([ [10, 0], [0, 0]  ]), (0),      'W direction';

and change it to:

    is line_direction([ [10, 0], [0, 0]  ]), (PI),     'W direction';

the test passes on i686, so the routine returned PI, which should not be
possible.

It seems that the comparison (atan2 == PI) was false in C++, but true in Perl.

This sample program however:

    #include <iostream>
    #include <iomanip>
    #include <math.h>
    #define PI 3.141592653589793238
    int main(int argc, char **argv)
    {
      double pi = atan2(0, -10);
      std::cout << std::setprecision(35) << pi;
      if (pi == PI) std::cout << " == ";
      else std::cout << " != ";
      std::cout << PI << std::endl;
      return 0;
    }

Produces:

    3.1415926535897931159979634685441852 ==
3.1415926535897931159979634685441852

in rawhide i686 mock. My head hurts :(

-- 
You are receiving this mail because:
You are on the CC list for the bug.
--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/perl-devel





[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Legacy Announce]     [Fedora PHP Devel]     [Kernel Devel]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Big List of Linux Books]     [Gimp]     [Yosemite Information]
  Powered by Linux