View Single Post
Old 07 February 2022, 22:08   #1336
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by paraj View Post
Using latest version of amiga-gcc (4766d09 / Dec 24 2021) atan2(-1, 1) has wrong sign when compiling with -m68881 but *without* -noiexemul. I think this is the case for the entire quadrant.

Test case:
Code:
#include <stdio.h>
#include <math.h>
volatile double x = 1, y = -1;
int main() {
    printf("atan2(%f, %f) = %f (%f degrees)\n", y, x, atan2(y, x), atan2(y, x) * 180 / 3.141592653589793);
    return 0;
}
Results:
Code:
-mcpu=68020 -m68881 -lm             atan2(-1.000000, 1.000000) = 0.785398 (45.000000 degrees)
-mcpu=68020 -lm                     atan2(-1.000000, 1.000000) = -0.785398 (-45.000000 degrees)
-mcpu=68020 -m68881 -noixemul -lm   atan2(-1.000000, 1.000000) = -0.785398 (-45.000000 degrees)
(Not a big deal, the only reason I compiled without -noixemul is because I forgot, but quite noticeable when creating a tunnel table )

the libs for 68881 weren't build, which are returning fp values in fp0...
I supplemented the missing combinations to the multilib info and with the correct version linked also the default (newlib) yields the correct result.


... and building takes now: infinite + x% ^^
bebbo is offline  
 
Page generated in 0.04460 seconds with 11 queries