Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to put in a wobble in a calculation
Message
From
17/10/2006 06:47:54
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01162413
Message ID:
01162464
Views:
17
>Hi Tore
>
>>If I understand correctly, what about something like yourresult=yourresult*(0.95 + (0.1*rand(-1))). This will give you a result which is max ±5% from the correct answer.
>
>I have multiple calculations so, does all of them have to have RAND(-1)?

rand(-1) should be called first, one time only. This will start the randomizer, based on the system time.

After that, if you calculate several times, just use rand().
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