[obfilter: mysql database] Roger Baklund wrote:
> * Benjamin Pflugmann >>Think the other way around: If the other option is to have no floating >>point type at all, a "not perfect" one may be good enough for many >>cases. > I agree, to some extent, but a growing number of users are 'normal people', > not coders/programmers... sql has this nasty 'human language'-like syntax, > which may seem as an invite for non-nerds... they wouldn't understand rtfm > even if you spelled it out... ;o) Plus, you often *do* want to use fractions, or even rational numbers, without using floating-point. Yes, there's a distinction. Fractions (fixed-point) are a common numerical type used in financial and other computations. Oracle, and many other databases, provide a fixed-point numeric type (e.g. Oracle's NUMBER(digits,precision) type) that's carried around in a decimal or BCD-like representation, and has software libraries to do exact arithmetic (inasmuch as you can do exact arithmetic with fixed-point types). Rational numbers are a whole different story, of course (how do you represent "1/3" exactly?), so I'm not going to go down that path.. But MySQL could definitely benefit with implementing a fixed-point, BCD-encoded numeric data type with software arithmetic libraries. It would ease the pain for a lot of programmers, and those who value execution speed over numerical accuracy can use the "binary" (floating-point) types. (Suggested syntax: "DECIMAL (digits, precision)". The existing DECIMAL type can, I think, safely be hijacked for this.) -- Shankar. --------------------------------------------------------------------- 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