Consider:
Code: Select all
Sub Main()
console.writeline(cstr(-90.0 mod 360.0))
End Sub
Tom
Code: Select all
Sub Main()
console.writeline(cstr(-90.0 mod 360.0))
End Sub
Just so. It is unfortunate that BasicX, which also derives from Visual Basic, returns a positive result. When we were implementing ZBasic, we had to choose whether it was more important to be compatible with VB or BasicX. In this particular case we opted for VB compatibility and noted the difference in the Compatibility Issues section of the ZBasic Reference Manual.mikep wrote:As ZBasic is derived from Visual Basic, it uses the same scheme as Visual Basic which is to use the sign of the dividend.
Code: Select all
result = ((angle Mod 360.0) + 360.0) Mod 360.0