Do Insights really need so many significant figures?
- Topic: Bug
- Thread starter DrClaude
- Start date
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
8 replies · 2K views
Physics news on Phys.org
Discussion
- 20,002
- 11,122
I changed the number of significant digits displayed in floating point numbers from 14 to 17. Might be what caused this issue. I'll revert back to 14.
Mentor
- 37,555
- 14,432
Change it to 3 or 2? There is no point in having more.
- 20,002
- 11,122
Default is 14, so there must be some reason the PHP devs think it's a good value.mfb said:Change it to 3 or 2? There is no point in having more.
- 7,549
- 3,074
http://php.net/manual/en/function.round.php
from http://php.net/manual/en/function.printf.php
from http://php.net/manual/en/function.printf.php
Code:
You can use this function to format the decimal places in a number:
$num = 2.12;
printf("%.1f",$num);
prints:
2.1
Mentor
- 37,555
- 14,432
Well, if it is a general PHP setting: PHP has no idea how precise these numbers are supposed to be. 14 is small enough to avoid displaying rounding errors in most cases, and large enough to keep more digits than anyone is reasonably interested in (with extremely few exceptions).Greg Bernhardt said:Default is 14, so there must be some reason the PHP devs think it's a good value.
Similar threads
- maxelcat
- · Replies 19 ·
- Introductory Physics Homework Help
- Replies
- 19
- alphaj
- · Replies 7 ·
- Biology and Chemistry Homework Help
- Replies
- 7
- Anshul23
- · Replies 4 ·
- Introductory Physics Homework Help
- Replies
- 4
High School
How many significant figures in 110 km/h?
- e-zero
- · Replies 73 ·
- Classical Physics
- Replies
- 73
- 121910marj
- · Replies 14 ·
- Classical Physics
- Replies
- 14
- sbrothy
- · Replies 2 ·
- General Discussion
- Replies
- 2
- eurekameh
- · Replies 7 ·
- Other Physics Topics
- Replies
- 7
- fs93
- · Replies 6 ·
- Other Physics Topics
- Replies
- 6
- helpmedude
- · Replies 1 ·
- Introductory Physics Homework Help
- Replies
- 1
- solarwind
- · Replies 1 ·
- Set Theory, Logic, Probability, Statistics
- Replies
- 1