Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A simplier math formula
Message
From
18/12/2008 10:39:33
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turkey
 
General information
Forum:
Politics
Category:
Other
Miscellaneous
Thread ID:
01367448
Message ID:
01368523
Views:
8
>No bug that I can see;
>
>?5-2^2
> 1st 2^2 = 4
> 2nd 5-4 = 1
>
>?-2^2
>  1st -2^2 = 4
>
>
>The - sign in 5-2^2 is subtraction wile in -2^2 it is a unary sign making 2 a negative number. In the second equation the - (unary sign) has precedence over the exponentiation while in the 5-2^2 the - is subtraction and it has a lower precedence from exponentiation so 2 is squared to 4 and then the subtraction is done 5-4 = 1.
>
>I don't see any bug nor any inconsistency.
a=2

?-a^2

?5-a^2

?-a^2+5

if 5-a^2<>-a^2+5
  ?"there is a inconsistency, vfp sometimes get it left sometimes get it right, and vfp should obey math. rules"
endif
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform