fmodf

Equivalent of fmodf in C#?

In C++ C: Output: "1610612736" #include <math.h> #include <stdio.h> int main(int argc, char** argv) { printf("%d\n", fmodf(5.6f, 6.4f)); getchar(); } In C#: Output: "5.6" using System; static class Program { public static void Main(string[] args) { Console.WriteLine(5.6f % 6.4f); Console.Read(); ...

modf returns 1 as the fractional:

I have this static method, it receives a double and "cuts" its fractional tail leaving two digits after the dot. works almost all the time. I have noticed that when it receives 2.3 it turns it to 2.29. This does not happen for 0.3, 1.3, 3.3, 4.3 and 102.3. Code basically multiplies the number by 100 uses modf divides the integer value by...