Stories
Slash Boxes
Comments

SoylentNews is people

posted by Fnord666 on Wednesday August 14 2019, @11:59PM   Printer-friendly
from the that's-the-combination-to-my-luggage! dept.

https://www.jpl.nasa.gov/edu/news/2016/3/16/how-many-decimals-of-pi-do-we-really-need/

Earlier this week, we received this question from a fan on Facebook who wondered how many decimals of the mathematical constant pi (π) NASA-JPL scientists and engineers use when making calculations:

Does JPL only use 3.14 for its pi calculations? Or do you use more decimals like say: 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360

We posed this question to the director and chief engineer for NASA's Dawn mission, Marc Rayman. Here's what he said:


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by Immerman on Friday August 16 2019, @01:56AM (1 child)

    by Immerman (3985) on Friday August 16 2019, @01:56AM (#880821)

    The language doesn't matter - the problem is that the CPU itself can't do decimal arithmetic. Full stop. (aside from BCD on some uncommon processors). If the language looks like it's doing decimal arithmetic, then it's playing inefficient software-based tricks behind the scenes. In the case of Java's BigDecimal, *dangerous* software tricks that can easily cause numerous problems that can truncate your results from either end (loss of most- or least- significant digit information) if used carelessly without fully understanding its weaknesses. I assume COBOL is more robust given its business pedigree, but don't know it well enough to comment.

    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 0) by Anonymous Coward on Friday August 16 2019, @05:39PM

    by Anonymous Coward on Friday August 16 2019, @05:39PM (#881194)

    What are you going on about?
    Java BigDecimal is a very well though out system.
    The fact that the arithmetic is done "in software" versus "in the CPU" is of no consequence.
    There is nothing about "in the CPU" that makes a system of arithmetic foolproof.
    There are things you have to be aware of with IEEE floating point arithmetic as well so that you don't accidentally end up with bad accuracy in your results.