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();
}
}
Clearly not the same output. Suggestions?
Try with
printf("%f\n", fmodf(5.6f, 6.4f))
instead.