XboxDev / nxdk-pdclib

The Public Domain C Library (adapted for original Xbox / nxdk toolchain)
http://pdclib.rootdirectory.de
Creative Commons Zero v1.0 Universal
19 stars 9 forks source link

Math improvements #9

Closed thrimbor closed 5 years ago

thrimbor commented 5 years ago

This contains all of my work to get math.h libc++-compatible, plus a few extras:

dracc commented 5 years ago

I've written a (very ugly) test program for this and checked all the new math functions. It ran the functions, taking M_PI and/or M_PI_2 as arguments, casted the results to int and wrote the values using debugPrint("%i"). They all work as expected. :+1:

(I tried all the "usual" ways of printing float/double values using printf (%f, %F, %e, %E, %g, %G), none seems to be working. Thus commenced the casting.)

JayFoxRox commented 5 years ago

Merged; thanks to @thrimbor for the code, @dracc for testing.

We can test this again in the future, when we have a proper printf (either %f, or 0x%08X as workarounds if floats take too long). We can just follow-up quickfixes if there are any issues.