11-28-2022, 11:56 AM
@Chris
let me know if this seems correct to you
let me know if this seems correct to you
Code: (Select All)
Print fmod(-1, 5), " -> 4"
Print fmod(-1.4, 5), " -> 3.6"
Print fmod(1.4, 5), " -> 1.4"
Print fmod(-7, 5), " -> 3"
Print fmod(-7.1, 5), " -> 2.9"
Print fmod(-1, -5), " -> -1"
Print fmod(-1.4, -5), " -> -1.4"
Print fmod(1.4, -5), " -> -3.6"
Print fmod(-7, -5), " -> -2"
Print fmod(-7.1, -5), " -> -2.1"
Print fmod(-1, 5.2), " -> 4.2"
Print fmod(-1.4, 5.2), " -> 3.8"
Print fmod(1.4, 5.2), " -> 1.4"
Print fmod(-7, 5.2), " -> 3.4"
Print fmod(-7.1, 5.2), " -> 3.3"
Print fmod(-1, -5.2), " -> -1"
Print fmod(-1.4, -5.2), " -> -1.4"
Print fmod(1.4, -5.2), " -> -3.8"
Print fmod(-7, -5.2), " -> -1.8"
Print fmod(-7.1, -5.2), " -> -1.9"
Function fmod# (x As Double, y As Double)
fmod = x - Int(x / y) * y
End Function