Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bugs with literal double-precision floating-point number
Message
De
25/11/2003 10:16:52
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00852922
Message ID:
00853289
Vues:
24
Hi David,

------
>create table #fabio1 ( dp1 float )

>insert into #fabio1 values ( 2.2250738585072014E-308 )  
>insert into #fabio1 values ( 2.2250738585072015E-308 )
>insert into #fabio1 values ( 2.22507385850720141E-308 )
>insert into #fabio1 values ( 2.22507385850720125967091E-308 )
>insert into #fabio1 values ( -2.2250738585072014E-308 )
>insert into #fabio1 values ( -2.2250738585072015E-308 )
>insert into #fabio1 values ( -2.22507385850720141E-308 )
>insert into #fabio1 values ( -2.22507385850720125967091E-308 )

>insert into #fabio1 values ( 1.7976931348623157E+308 )
>insert into #fabio1 values ( 1.7976931348623158E+308 )
>insert into #fabio1 values ( 1.79769313486231571E+308 )
>insert into #fabio1 values ( 1.79769313486231571123456E+308 )
>insert into #fabio1 values ( -1.7976931348623157E+308 )
>insert into #fabio1 values ( -1.7976931348623158E+308 )
>insert into #fabio1 values ( -1.79769313486231571E+308 )
>insert into #fabio1 values ( -1.79769313486231571123456E+308 )

>select * from #fabio1
i copy/paste on SQL Query and run.

On my SQL version 8.00.760(SP3) i haven't invalid values.
Result is ( copy/paste from SQL Query):
2.2250738585072014E-308
2.2250738585072014E-308
2.2250738585072014E-308
2.2250738585072014E-308
-2.2250738585072014E-308
-2.2250738585072014E-308
-2.2250738585072014E-308
-2.2250738585072014E-308
1.7976931348623157E+308
1.7976931348623157E+308
1.7976931348623157E+308
1.7976931348623157E+308
-1.7976931348623157E+308
-1.7976931348623157E+308
-1.7976931348623157E+308
-1.7976931348623157E+308
Then i cannot comment anything.

-----
........Avoid using float or real columns in WHERE clause search conditions, especially the = and <> operators. It is best to limit float and real columns to > or < comparisons.

You known only this concept ?

-----
I'm curious as to why you always snip out the parts of my replies that ask questions and/or point out the errors in your "bug" reports?

I'm curious as to why, now, you ignore the your majour argument:
VFP and SQL Server uses different fp storage format.

NOW.

On SQL Server run this:
DECLARE @X FLOAT
SELECT @X=0.1E-14/1.797693134862315807999E+308
SELECT @X
-- surprise result is 4.9406564584124654E-324
-- then SQL Server support all VFP values
Next, on VFP run this:
CLEAR ALL
CLEAR

? 4.94065645841247E-324		, 'is zero', 4.94065645841247E-324 = 0.0E+0
* this return 0.000...0E+0  incorrect
? -4.94065645841247E-324	, 'is zero', -4.94065645841247E-324 = 0.0E+0
* this return -4,44659081257121E-323  incorrect
? 3.21E-310 					, 'is zero', 3.21E-310 = 0.0E+0
* this return 0.000....0E+0 , incorrect
? -3.21E-310 					, 'is zero', -3.21E-310 = 0.0E+0
* this return 3.210...410.0E-310, correct ? ; but comparison return equal to zero, incorrect

**********
? ' check precision ?'
x = -4.94000000000000E-318
y = -1.14000000000000E-318
? m.x + m.y
* result is aspected to - 6.08004100691279E-318, but precision is 5 digits
Fabio
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform