Why is "is_modulo" incorrect for double and float?
I wrote code to check if the 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()(of <math.h>) to find modulo floator double. So why is_modulofalse if you can find modulo float or double?
std::numeric_limits<T>::is_modulotrueT, , , , [min(),max()], , ,max()-min()+1.
- undefined, std::numeric_limits::is_modulo float double - false.