Re: How to detect a double's significant digits



Jeremy Bowers wrote:

Step one for mrstephengross is to *rigorously* define what he means by
"significant digits", then go from there. Since I think he mentioned
something about predicting how much space it will take to print out, my
suggestion is to run through whatever printing routines there are and get
a string out, the measure the string, as anything else will likely be
wrong. If that's not possible with the formatting library, you've already
lost; you'll have to completely correctly re-implement the formatting
library, and not only is that a major PITA, you almost never get it
bug-for-bug right...

Especially since all of his examples have the same number of significant digits (3), as the term is usually meant. Zeroes to the right are significant, not zeroes to the left.


--
Erik Max Francis && max@xxxxxxxxxxx && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
  What is it that shapes a species?
  -- Louis Wu
.



Relevant Pages

  • Re: How to detect a doubles significant digits
    ... How can I find out the number of significant digits (to the ... suggestion is to run through whatever printing routines there are and get ... a string out, the measure the string, as anything else will likely be ...
    (comp.lang.python)
  • Re: ANN: FPOUT v2.0
    ... REPRESENT for negative string lengths? ... to be the number of significant digits. ... "Rounding" and "significant ... No ambiguity there. ...
    (comp.lang.forth)
  • Re: c-addr/len
    ... A large number of words use "c-add u" to indicate the address of a ... string and its length on the stack. ... referring to the number of characters or address units. ... When did "u most significant digits of ...
    (comp.lang.forth)
  • Re: significant digits
    ... is two significant digits. ... As String ... Dim ZerosLeft As Integer, ZerosRight As Integer, ExtraZeros As Integer ... Debug.Print n, RSD ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Format to n significant digits?
    ... will *round* a number to 2 significant digits, ... Dim PartsAs String ... code window that opened up. ... What does it do that the ROUND formula above doesn't do? ...
    (microsoft.public.excel)