Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiplications shows * in some xp machines
Message
From
22/02/2010 18:18:37
 
 
To
22/02/2010 18:03:07
Victor Chignes
Inteliventas
Peru
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01450374
Message ID:
01450376
Views:
72
>Hello all.
>I have an application wich multiplies a 5 digits number by itself 3 times. In some Xp machines it works great, but in others it shows *********. What could be happening? And also, is there a way to calculate such expression (X**3 - 27) without messing with the machine capacity?

If it's just a variable expression, it should always work. The largest possible 5-digit number is 99999 e.g.
?99999**3  && displays result as 9.999700E+14 i.e. just under 10^15
If you're trying to assign a large value to a table or cursor column you might overflow it if it's not large enough. This could happen for cursors or intermediate result sets in, say, SELECT - SQL.

The numeric/float type has a range of - .9999999999E+19 to .9999999999E+20

The double type has a range of +/-4.94065645841247E-324 to +/-8.9884656743115E307

Either of those would be large enough to hold your result, but an Integer might not: -2147483647 to 2147483647

If the problem is in a SELECT - SQL, you could experiment with CAST().
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform