Quote: "The floor function returns an integer value.
Making: floor(-90.5/360) = 0
Then: -90.5 - 0 * 360 = -90.5
And:
floor(-365.5/360) = -1
-365.5 - (-1 * 360) = -725.5
"
print(floor(-90.5/360))
print(floor(-365.5/360))
actually produces;
-1
-2
You're thinking of Trunk().. From AGK/IDE/Help/reference/Core/Floor.htm
Quote: "Rounds a float to the next lowest integer. This differs from Trunc when using negative numbers, Trunc( -1.6 ) is -1 but Floor( -1.6 ) is -2."
so the function is good.
Here's some test code.
for i=-810 to 810 step 90
angle# = i - 0.5
printc( str( angle# , 2) + " : ")
print( str( WrapAngle(angle#) , 2 ) )
next i
which shows it over a decent range.

edit: test code & results pic
This get's my vote for function of the week
Nice find Dar13.