Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Compare values if some are in scientific notation
Message
From
25/05/2007 13:13:01
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
25/05/2007 13:03:41
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01228564
Message ID:
01228568
Views:
20
>I need to compare values some of which are in scientific notation (for example available disk space on two drives). The best I could come up with is to
>
>1. use the transform function to be sure all values are in scientific notation
>2. get the value of the exponents
>3. get the value of the mantissa
>4. compare the exponents and if needed the value of the mantissa
>
>Is there a better way?
>
>TIA

Can't you compare them directly? For example:
? 500 < 2e6
If the values are stored as texts, you can use val() to convert the individual values to numbers, or alternatively eval(), for example:
? eval("5e6") < eval("2e7")
* or even
? eval("5e6 < 2e7")
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform