eql?(p1)
public
Returns true only if obj is a Float with the same value as float.
Contrast this with Float#==, which performs type conversions.
The result of NaN.eql?(NaN) is undefined, so the implementation-dependent
value is returned.
1.0.eql?(1)
Show source
static VALUE
flo_eql(VALUE x, VALUE y)
{
if (RB_TYPE_P(y, T_FLOAT)) {
double a = RFLOAT_VALUE(x);
double b = RFLOAT_VALUE(y);
if (isnan(a) || isnan(b)) return Qfalse;
if (a == b)
return Qtrue;
}
return Qfalse;
}