

@classdef.method('inspect')
@classdef.method('to_s')
def method_to_s(self, space):
    if math.isinf(self.floatvalue):
        if (self.floatvalue >= 0):
            return space.newstr_fromstr('Infinity')
        else:
            return space.newstr_fromstr('-Infinity')
    elif math.isnan(self.floatvalue):
        return space.newstr_fromstr('NaN')
    else:
        return space.newstr_fromstr(formatd(self.floatvalue, 'g', DTSF_STR_PRECISION, DTSF_ADD_DOT_0))

dataset/ETHPy150Open topazproject/topaz/topaz/objects/floatobject.py W_FloatObject.method_to_s/original