For example, take this IRB session:
1.9.3-p385 :046 > float = func_that_creates_large_float => 1.5815450433041317e+51 1.9.3-p385 :047 > float.to_i => 1581545043304131697954259018410479150921451567054848 Can I be sure that the integer returned to me represents the same value as the float? I ask mainly because the Ruby documentation describes the to_i method on the Float class as "Returns the float truncated to an Integer". The word 'truncated' jumps out at me.
Edit: I think describing my situation would make it clear why I'm asking this. I'm trying to take the cube root of a large integer that I know will result in an integer as well. The cube root function uses a float to do its calculation, giving my result as a float. I need the NON-scientific-notation value and have no idea how to approach this.
Thank you.
x.ye+zwhen converted to a string... but that's just a text representation, not a fundamental difference between such values and ones like 1.5floatreally is a float? What is the result offunc_that_creates_large_float.class?Float. I'm thinking I've asked the wrong question here, I should have posted something like "How to convert from a very large integer, to a float, and back, with no corruption of the value?"