From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,df84b868ad64e4f7 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 01 Aug 2005 01:50:21 -0500 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: OT: definition of "significant figures" References: X-Newsreader: Tom's custom newsreader Message-ID: Date: Mon, 01 Aug 2005 01:50:21 -0500 NNTP-Posting-Host: 24.6.143.98 X-Trace: sv3-1gOHDIJvOurTLzBuXccqnP9Jx5ygHhfyQb9LW9F+HkgVdpw/fGXqrhnJFCVoZfrsQR5kkuVLNBExPap!jitfY6K5Pf56CE+7yIu/iqSRaoYxYsBl++7qD9ziAYIODYExS7TlVvWwGhz+QbnCLzF8SwYHGh4= X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:3871 Date: 2005-08-01T01:50:21-05:00 List-Id: I think a better formula for the number of digits to display is Digit_Count := Integer(Long_Float'ceiling(Log(Abs(Avg),10.0))) -Integer(Log(Sd,10.0)); where the positive addition to the digits comes from a 'ceiling on log(avg), but a subtraction from the number of digits comes from a rounded value of log(sd) Using this formula, one gets > The average of 2.1, 33.1, 2.2 avg = 12.46666, sd = 16.24 log(avg) = 1.096, 'ceiling = 2 log(sd) =-1.211, rounded = 1 so the digit count is 1, rather than log(avg/sd)= -0.1 If you don't use the 'ceiling, consider the case where the x(i) are in the range 99.990 .. 99.999, vs the same set with .01 added, so their range is 100.000 .. 100.009 Since their std devs are the same, in the .00x range, their averages ought to be represented with the same number of digits to the right of the decimal. The 100's shouldn't lose a digit compared to the 9's.