Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MOD doesn't work with type FIXED (*solved*)
#3
Ok, the bug has been fixed. Keep in mind that "MOD" is supposed to be used only with positive integer (Ubyte, UInteger, ULong) types. Anyway, the MODF16 is implemented, and it should work as expected, but due to the lack of precision, the following issues might happen:
  1. Lost of precision: 5 mod 3 = 2, but for fixed values it renders to 1.99999 aprox
  2. For negative numbers, the sign is propagated to the modulo.

The A mod B function is implemented as: fract(A / B) * B
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)