On 10/22/26 11:42 AM, Anton Ertl wrote:
> Krishna Myneni <kris…@ccreweb.org> writes:
...
>>>> ...  However, given that the program >>>> usually does not compute this information, the Gforth words that you >>>> can pass a precision to, such as F.RDP and E.P, treat it as a minimum >>>> rather than exact number of significant digits to be shown, i.e., they >>>> may show more digits.  E.g.: >>>> >>>> 123e 2 e.p \ prints "123e" >>>>
>>> >>> This sort of behavior, not getting what you asked for, is not likely to >>> be used by the scientific community. In calculations or experiments, it >>> is important to show the actual number of significant digits. >>> >>>
>> >> In calculations or experiments, it is important to show the actual >> number of *requested* significant digits, often followed by an >> uncertainty estimate. If an uncertainty is not specified, then the >> uncertainty is assumed to be +/-5 units in the n+1th digit, where n is >> the number of significant digits shown.
> > E.P is obviously not made for showing 1.2e2, but I see no harm in > showing 123e +/-5e >
"120 +/-5", or simply, "120" means something quite different from "123 +/- 5". The latter means that the third digit has some significance so there are three significant digits i.e. there was some basis for obtaining the third digit in measurement, or for retaining it, in computation. "123 +/- 5" is not different from "123. +/- 5" For example, in computation, you may have a set of measurements of the same quantity with two significant digits in each measurement, 120 160 110 120 130 120 140 110 110 110 The uncertainty in each individual measurement in the set is implied to be +/- 5 unless a different measurement uncertainty is specified. If we compute the mean of the set, it is 123 and its uncertainty, the uncertainty of the mean, is 5/sqrt(N), where N=10 (this is only true when there are statistical errors; it does not include systematic errors). The computed mean should be expressed as 123. +/- 1.6 The trailing decimal point in "123." is optional. The uncertainty in the mean cannot just be implied anymore. Since the uncertainty of this computed number is larger than +/- 0.5 it must be explicitly printed. Now suppose we had a set of measurements with three significant digits in each measurement with the same numbers as above. The measurements would be written with the trailing decimal point as 120. 160. 110. 120. 130. 120. 140. 110. 110. 110. Again, it would have the same mean, but the uncertainty of the mean is now ten times smaller, owing to the implied uncertainty in each measurement of +/- 0.5. The mean uncertainty now is 0.5/sqrt(10), and again, we must explicitly print it, since it smaller than +/- 0.5. 123. +/- 0.16 Therefore, the placement of the decimal point is important, but when the uncertainty is greater than or less than 5 in the next decimal place, the uncertainty should be explicitly specified. For rounding a floating point number to n significant digits, the uncertainty in the number is always +/- 5 in the n+1 digit.
-- Krishna