I wrote some code to check if a type has a modulo representation:
#include <iostream>
#include <limits>
using namespace std;
int main( )
{
cout << "Whether float objects have a modulo representation: "
<< numeric_limits<float>::is_modulo << endl;
cout << "Whether double objects have a modulo representation: "
<< numeric_limits<double>::is_modulo << endl;
}
Output:
Whether float objects have a modulo representation: 0
Whether double objects have a modulo representation: 0
But we can use fmod()
(from <math.h>
) to find modulo of float
or double
. So, why is is_modulo
false if it is possible to find a modulo of a float or double?