[Tutor] class uncertainty
Tue, 28 Aug 2001 08:06:32 -0500
>>===== Original Message From "Christopher Smith" <email@example.com>
>>I've created a class which keeps track of the uncertainty in a number and
>>subsequent calculations performed with that number. It works like this:
>>u=uncertainty #shorten the name
>># define physical measurements
>># with +/-1 in last digit by default
>># define a physical measurement witha larger uncertainty
>>#do the calculation and look at results
>># 24 +/- 9
>Looks neat... why is u() taking strings, though?
To avoid missing an intended trailing 0 (5.00) looking like 5.0)
or excessive digits b/c of floating representation issues (5.1 looking
like 5.09999999996 to the function).