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

----------------
<snip>
Approximate number data types for use with floating point numeric data. Floating point data is approximate; not all values in the data type range can be precisely represented.

Please note the words I've highlighted. And then the table lists 15 digits as the maximum precision.

This does not have some importance with the ruotine of conversion of a literal value.
The ruotine must find the value more close, and must respect the rule that I have written.

-----------
Visual FoxPro's double would appear to use a slightly different sign/mantissa/exponent storage because the range of Visual FoxPro double is not the exact same as SQL.

This inference does not have logic ( also for integer and currency the range is different ).

-----------
Visual FoxPro = +/-4.94065645841247E-324 to +/-8.9884656743115E307 - please note that these examples use 15 digits of precision.
SQL = - 1.79E + 308 through 1.79E + 308

First the SQL range is incomplete.
Second, for SQL Server the range is:
±2.22507385850720125967091E-308 to ±1.7976931348623157E+308

>I expected one full correspondence between the two environments.

Since they aren't the same tool you should adjust your expectation. Floating point representation is typically the biggest place where laguages differ from one another.

I think double rapresentation is the same.
If it is not true, VFP not support SQL Server double data type.

For SQL real it is true for VFP, but for SQL Server double also !

Fabio
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform