2 messages in com.mysql.lists.mysqlRe: PROBLEMS UNDERSTANDING FLOAT/DOUB...| From | Sent On | Attachments |
|---|---|---|
| Keith Stokes | 19 Apr 2001 07:15 | |
| Rolf Hopkins | 19 Apr 2001 20:02 |
| Subject: | Re: PROBLEMS UNDERSTANDING FLOAT/DOUBLE COLUMN TYPES![]() |
|---|---|
| From: | Rolf Hopkins (rhop...@mail.waytech.com.tw) |
| Date: | 04/19/2001 08:02:50 PM |
| List: | com.mysql.lists.mysql |
----- Original Message ----- From: "Keith Stokes" <1007...@compuserve.com> To: "mysql" <mys...@lists.mysql.com> Sent: Thursday, April 19, 2001 22:15 Subject: PROBLEMS UNDERSTANDING FLOAT/DOUBLE COLUMN TYPES
PROBLEMS UNDERSTANDING FLOAT/DOUBLE COLUMN TYPES
First could you clarify the contradictions from the following extracts of the manual.
7.3 Column types
The column types supported by MySQL are listed below. The following code letters are used in the descriptions:
M Indicates the maximum display size. The maximum legal display size is 255. D Applies to floating-point types and indicates the number of digits following the decimal point. The maximum possible value is 30, but should be no greater than M-2.
Square brackets (`[' and `]') indicate parts of type specifiers that are optional.
Note that if you specify ZEROFILL for a column, MySQL will automatically add the UNSIGNED attribute to the column.
FLOAT[(M,D)] [ZEROFILL] A small (single-precision) floating-point number. Cannot be unsigned. Allowable values are -3.402823466E+38 to -1.175494351E-38, 0 and 1.175494351E-38 to 3.402823466E+38. The M is the display width and D is the number of decimals. FLOAT without an argument or with an argument of <= 24 stands for a single-precision floating point number. DOUBLE[(M,D)] [ZEROFILL] A normal-size (double-precision) floating-point number. Cannot be unsigned. Allowable values are -1.7976931348623157E+308 to -2.2250738585072014E-308, 0 and 2.2250738585072014E-308 to 1.7976931348623157E+308. The M is the display width and D is the number of decimals. DOUBLE without an argument or FLOAT(X) where 25 <= X <= 53 stands for a double-precision floating point number.
7.7 CREATE TABLE syntax
DOUBLE[(length,decimals)] [UNSIGNED] [ZEROFILL] FLOAT[(length,decimals)] [UNSIGNED] [ZEROFILL] DECIMAL(length,decimals) [UNSIGNED] [ZEROFILL] NUMERIC(length,decimals) [UNSIGNED] [ZEROFILL]
As you can see from the above the FLOAT/DOUBLE columns cannot be unsigned or can they?.
I don't understand what you mean. Where does it say it CAN'T be unsigned? To me, it is quite obvious that it can be.
Second problem what is "Allowable values are -3.402823466E+38 to -1.175494351E-38, 0 and 1.175494351E-38 to 3.402823466E+38 " in real numbers I.E. how many digits?.
Again I do not understand what you are asking. You can, but it is impractical, to write -1.175494351E-38 as
-0.00000000000000000000000000000000000001175494351
Or do you mean the number of significant digits, which is described as M & D at the start?
Or have I totally misunderstood you?
Thanking you in advance
Keith Stokes
--------------------------------------------------------------------- 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 <mysq...@lists.mysql.com> To unsubscribe, e-mail <mysql-unsubscribe-rhopkins=mail...@lists.mysql.com> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




