Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Invert a numeric value
Message
De
14/04/2005 09:38:38
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
14/04/2005 07:48:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7
OS:
Windows 2000 SP4
Divers
Thread ID:
01004535
Message ID:
01004621
Vues:
14
>
>x = 12345
>x = 0 - x  && Invert the sign x = -12345
>x = 0 - x  && Invert the sign x = +12345
>
While this should give you the correct solution, the zero is not really required: x = -x is enough.
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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform