Reputation: 3044
I'm trying to use std::numeric_limits<float>::epsilon()
in c.
The description says
Returns the machine epsilon, that is, the difference between 1.0 and the next value representable by the floating-point type T.
How can I represent the identical value in c?
Upvotes: 0
Views: 252
Reputation: 23500
#include <float.h>
and use
FLT_EPSILON
DBL_EPSILON
LDBL_EPSILON
See here: http://www.cplusplus.com/reference/cfloat/
Upvotes: 4