Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Mathematica: dealing with significant figures

  1. Sep 1, 2010 #1
    Hi everyone.

    Hopefully this is easy to solve.

    I have large amounts of mined data that have differing levels of precision. I want to do analysis of:

    1) number of decimal places present
    2) significant figure error intervals based on the precision (for instance, 0.003 could have been rounded from 0.0025 to 0.0035)

    I can't find a clean way to do it in Mathematica, as importing my data makes it all 'MachinePrecision' and it thinks everything has 15.9456 digits of precision.

    I've tried back doors, such as doing a StringLength[ToString[x]] but even that doesn't work for very small decimals, as it introduces scientific notation which throws everything off.

    Any ideas?
     
  2. jcsd
  3. Sep 1, 2010 #2

    Hurkyl

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Have you looked at the Interval function?
     
  4. Sep 1, 2010 #3
    The interval function does not appear to be what I am looking for. I have a single value, and need to specify a range based on significant figures rules for that one value. The interval function requires a range as input.
     
  5. Sep 1, 2010 #4
    I would just force them all to be scientific notation, that way you know the precision. You can pluck out the precision pretty easy.

    j = { .00000000000000000001,.00000000000000000000000001.,.0000000000000001}

    NumberForm[j, NumberFormat->(#3&)]

    Now you have a list of precisions. You can feed those into the interval range function, and just put your error ranges on in front of the exponent.

    There is probably a better way, but this probably solves it.. that way you don't have to force variable precision, which will slow down your calculations.
     
  6. Sep 1, 2010 #5
    This one

    ScientificForm[j, NumberFormat -> (#3 &)]
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook