Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A simplier math formula
Message
De
18/12/2008 10:39:33
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turquie
 
Information générale
Forum:
Politics
Catégorie:
Autre
Divers
Thread ID:
01367448
Message ID:
01368523
Vues:
7
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform