vircon32 / ComputerSoftware

General repository for all software (emulators, dev tools, etc) related to Vircon32 but not running on console itself
http://www.vircon32.com
Other
32 stars 3 forks source link

atan2 function has incorrectly labeled arguments #8

Closed t0mmyka closed 3 weeks ago

t0mmyka commented 3 weeks ago

OpCode 61, ATAN2 uses register 1 as the Y component and register 2 as the X component. However in math.h atan2 labels the first argument X and uses it as register 1 and labels the second argument Y and uses it as register 2, and the C API reference page for math.h also labels the first argument X and the second Y. This means that both OpCode and the atan2() function in math.h follow the common practice of Y first X second, but the documentation for math.h labels it incorrectly.

vircon32 commented 3 weeks ago

Thank you for spotting this t0mmyka! You are indeed right. Fortunately it seems that all of my programs using atan2 were actually passing arguments in the correct order despite the swapped names. I just corrected this in math.h and in the website API reference too, so I will close this issue.