Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reduce to zero
Message
De
05/02/2009 12:20:00
 
 
À
05/02/2009 11:19:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01379529
Message ID:
01379541
Vues:
24
>Here is probably a simple math problem but I seem to have a mental block:
>
>I want to reduce any given number to zero in 10 steps or loops. In each loop iteration I only have access to the previous value, not the initial starting value. I was thinking of subtracting a percentage off the previous value but that will not reduce to zero in 10 steps especially given that the number can have up to 4 decimals. Any obvious solution?
>
>Update: I also cannot know what iteration I am on. In other words, I want to reduce a number by some formula and know that within +/-10 iterations the number will fall to zero.

Well, I've rethought it, and personally, I'm stumped. If you don't know the starting value, and you don't know which step you're on, then you can't know if the number you have is already reduced partially (or even completely) or not. I don't see how it's possible to do without knowing either of those parameters.

Gonna take somebody smarter than me to come up with it.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform