>From: MySQL <[EMAIL PROTECTED]>
>
>   From: "Madscientist" <[EMAIL PROTECTED]>
>
>   You might also consider using two integer type fields - one for the
>   numerator and another for the denominator. This way storage and recovery are
>   easy and the mathematics are wide open.
>   _M
>
>I suspect that a float add is faster than 3 integer multiplies and
>sum.

Ah, but it is not as accurate!

If the original poster knows he needs fractions, he won't be happy with float.

Just as one should NEVER use floating point to represent money, one should NEVER use 
it for representing fractions that need to be precise. For example, (1/3 as a float) * 
3 will come out to 0.99999999.

-- 
: Jan Steinman -- nature photography: <http://www.Bytesmiths.com>
: Bytesmiths -- artists' services: <http://www.Bytesmiths.com/Services>
: Join the forums at <http://www.Bytesmiths.com/wiki>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to