Colin Law wrote in post #970449:
> On 24 December 2010 03:59, Marnen Laibow-Koser <[email protected]>
> wrote:
>> [...]
>> I'm not sure Float has a proper use case at all. :)
>
> Consider  table containing the masses of objects.  Columns description
> and mass (kg), with the following records
> apple, 0.2
> earth, 5.9742E24
> sun, 1.98892E30
> super massive black hole, 1.0E39
>
> What column type would be appropriate for storing the mass?

Irrelevant.  If I understand you correctly, you're asking about DB 
column types, not Ruby column types.

Anyway, the answer is: it depends.  If I didn't need arbitrary 
precision, I'd store them as floats in the DB, and then change to 
BigDecimal before doing any math on them.

If I did need arbitrary precision, and the DB didn't provide a 
BigDecimal-like type, I'd store them as strings.

>
> Colin

Best,
-- 
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Sent from my iPhone

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to