on 2012 Jun 06 2:13 AM
Hi, a have a problem with float data type
i enter this code
create table #a(f float, d double) insert into #a values(20350.35, 20350.35) select * from #a
I see a different result in column f and d
f d 20350.349609375 20350.35
i use SQL Anywhere 12. in early versions, such as ASA 8 was float_as_double option, that can solve this problem
is it bug?
Request clarification before answering.
It is by design - cf. the v11.0.0 "SQL Anywhere deprecated and discontinued features" docs - to cite:
float_as_double
In SQL Anywhere, the FLOAT keyword never behaves like Adaptive Server Enterprise's FLOAT keyword when a precision is not specified. SQL Anywhere does not treat FLOAT values the same as DOUBLE values.
For Open Client and jConnect connections, this behavior is different from the default behavior in previous releases.
When unloading or connecting to older databases with materialized views, the setting of this option is ignored.
Without that option, a FLOAT without precision is equivalent to the REAL data type and requires 4 bytes of storage, whereas a DOUBLE requires 8 bytes.
So I guess you ought to bring the datatypes into line (or use FLOAT with an explicit precision, such as FLOAT(53) - that should be identical to DOUBLE).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
29 | |
9 | |
8 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.