How does Mathematica determine when to use scientific notation?
Clash Royale CLAN TAG#URR8PPP
up vote
4
down vote
favorite
I have code that takes an initial guess for a set of parameters to use in a function that I want to minimize, calculates the function, prints the value, recalculates new parameters via the gradient descent method, recalculates the function, prints it, and so on.
This is what my output looks like:
I don't mind it, I'm just curious as to when Mathematica decides it should use scientific notation and when it thinks regular notation is fine. At first sight, it seems random.
MWE not necessary because this is not a question related to code.
Edit: Sorry for the huge image. I've replaced it with a smaller one.
output-formatting precision notation
add a comment |Â
up vote
4
down vote
favorite
I have code that takes an initial guess for a set of parameters to use in a function that I want to minimize, calculates the function, prints the value, recalculates new parameters via the gradient descent method, recalculates the function, prints it, and so on.
This is what my output looks like:
I don't mind it, I'm just curious as to when Mathematica decides it should use scientific notation and when it thinks regular notation is fine. At first sight, it seems random.
MWE not necessary because this is not a question related to code.
Edit: Sorry for the huge image. I've replaced it with a smaller one.
output-formatting precision notation
1
You can useNumberForm
with itsScientificNotationThreshold
setting if you want more control.
â J. M. is somewhat okay.â¦
3 hours ago
I know I can. As I said, I don't mind which notation Mathematica uses for this; I'm just curious as to how it determines which one to use.
â Rain
3 hours ago
1
I don't have your numbers, so I can only hazard a guess that it's about precision differences. See e.g.97170., 97170.`5, 97170.`4
.
â J. M. is somewhat okay.â¦
3 hours ago
I suspect the message formatting is using the same thresholds asNumberForm
.
â Daniel Lichtblau
2 hours ago
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
I have code that takes an initial guess for a set of parameters to use in a function that I want to minimize, calculates the function, prints the value, recalculates new parameters via the gradient descent method, recalculates the function, prints it, and so on.
This is what my output looks like:
I don't mind it, I'm just curious as to when Mathematica decides it should use scientific notation and when it thinks regular notation is fine. At first sight, it seems random.
MWE not necessary because this is not a question related to code.
Edit: Sorry for the huge image. I've replaced it with a smaller one.
output-formatting precision notation
I have code that takes an initial guess for a set of parameters to use in a function that I want to minimize, calculates the function, prints the value, recalculates new parameters via the gradient descent method, recalculates the function, prints it, and so on.
This is what my output looks like:
I don't mind it, I'm just curious as to when Mathematica decides it should use scientific notation and when it thinks regular notation is fine. At first sight, it seems random.
MWE not necessary because this is not a question related to code.
Edit: Sorry for the huge image. I've replaced it with a smaller one.
output-formatting precision notation
output-formatting precision notation
edited 50 mins ago
Carl Woll
58.8k276150
58.8k276150
asked 3 hours ago
Rain
301110
301110
1
You can useNumberForm
with itsScientificNotationThreshold
setting if you want more control.
â J. M. is somewhat okay.â¦
3 hours ago
I know I can. As I said, I don't mind which notation Mathematica uses for this; I'm just curious as to how it determines which one to use.
â Rain
3 hours ago
1
I don't have your numbers, so I can only hazard a guess that it's about precision differences. See e.g.97170., 97170.`5, 97170.`4
.
â J. M. is somewhat okay.â¦
3 hours ago
I suspect the message formatting is using the same thresholds asNumberForm
.
â Daniel Lichtblau
2 hours ago
add a comment |Â
1
You can useNumberForm
with itsScientificNotationThreshold
setting if you want more control.
â J. M. is somewhat okay.â¦
3 hours ago
I know I can. As I said, I don't mind which notation Mathematica uses for this; I'm just curious as to how it determines which one to use.
â Rain
3 hours ago
1
I don't have your numbers, so I can only hazard a guess that it's about precision differences. See e.g.97170., 97170.`5, 97170.`4
.
â J. M. is somewhat okay.â¦
3 hours ago
I suspect the message formatting is using the same thresholds asNumberForm
.
â Daniel Lichtblau
2 hours ago
1
1
You can use
NumberForm
with its ScientificNotationThreshold
setting if you want more control.â J. M. is somewhat okay.â¦
3 hours ago
You can use
NumberForm
with its ScientificNotationThreshold
setting if you want more control.â J. M. is somewhat okay.â¦
3 hours ago
I know I can. As I said, I don't mind which notation Mathematica uses for this; I'm just curious as to how it determines which one to use.
â Rain
3 hours ago
I know I can. As I said, I don't mind which notation Mathematica uses for this; I'm just curious as to how it determines which one to use.
â Rain
3 hours ago
1
1
I don't have your numbers, so I can only hazard a guess that it's about precision differences. See e.g.
97170., 97170.`5, 97170.`4
.â J. M. is somewhat okay.â¦
3 hours ago
I don't have your numbers, so I can only hazard a guess that it's about precision differences. See e.g.
97170., 97170.`5, 97170.`4
.â J. M. is somewhat okay.â¦
3 hours ago
I suspect the message formatting is using the same thresholds as
NumberForm
.â Daniel Lichtblau
2 hours ago
I suspect the message formatting is using the same thresholds as
NumberForm
.â Daniel Lichtblau
2 hours ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
6
down vote
Mathematica uses 2 criteria to determine whether to show a number in scientific notation or not.
For both arbitrary precision and machine precision numbers, use scientific notation if the exponent is not between 5 and -5 inclusive:
123456.
1234567.
123456.
1.23457*10^6
and:
1.23456*^-5
1.23456*^-6
0.0000123456
1.23456*10^-6
For arbitrary precision numbers, use scientific notation if the number of digits displayed is more than the precision:
123400`4
123400`5
123400`6
1.234*10^5
1.2340*10^5
123400.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
Mathematica uses 2 criteria to determine whether to show a number in scientific notation or not.
For both arbitrary precision and machine precision numbers, use scientific notation if the exponent is not between 5 and -5 inclusive:
123456.
1234567.
123456.
1.23457*10^6
and:
1.23456*^-5
1.23456*^-6
0.0000123456
1.23456*10^-6
For arbitrary precision numbers, use scientific notation if the number of digits displayed is more than the precision:
123400`4
123400`5
123400`6
1.234*10^5
1.2340*10^5
123400.
add a comment |Â
up vote
6
down vote
Mathematica uses 2 criteria to determine whether to show a number in scientific notation or not.
For both arbitrary precision and machine precision numbers, use scientific notation if the exponent is not between 5 and -5 inclusive:
123456.
1234567.
123456.
1.23457*10^6
and:
1.23456*^-5
1.23456*^-6
0.0000123456
1.23456*10^-6
For arbitrary precision numbers, use scientific notation if the number of digits displayed is more than the precision:
123400`4
123400`5
123400`6
1.234*10^5
1.2340*10^5
123400.
add a comment |Â
up vote
6
down vote
up vote
6
down vote
Mathematica uses 2 criteria to determine whether to show a number in scientific notation or not.
For both arbitrary precision and machine precision numbers, use scientific notation if the exponent is not between 5 and -5 inclusive:
123456.
1234567.
123456.
1.23457*10^6
and:
1.23456*^-5
1.23456*^-6
0.0000123456
1.23456*10^-6
For arbitrary precision numbers, use scientific notation if the number of digits displayed is more than the precision:
123400`4
123400`5
123400`6
1.234*10^5
1.2340*10^5
123400.
Mathematica uses 2 criteria to determine whether to show a number in scientific notation or not.
For both arbitrary precision and machine precision numbers, use scientific notation if the exponent is not between 5 and -5 inclusive:
123456.
1234567.
123456.
1.23457*10^6
and:
1.23456*^-5
1.23456*^-6
0.0000123456
1.23456*10^-6
For arbitrary precision numbers, use scientific notation if the number of digits displayed is more than the precision:
123400`4
123400`5
123400`6
1.234*10^5
1.2340*10^5
123400.
edited 1 hour ago
xzczd
24.3k466232
24.3k466232
answered 1 hour ago
Carl Woll
58.8k276150
58.8k276150
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f182705%2fhow-does-mathematica-determine-when-to-use-scientific-notation%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
You can use
NumberForm
with itsScientificNotationThreshold
setting if you want more control.â J. M. is somewhat okay.â¦
3 hours ago
I know I can. As I said, I don't mind which notation Mathematica uses for this; I'm just curious as to how it determines which one to use.
â Rain
3 hours ago
1
I don't have your numbers, so I can only hazard a guess that it's about precision differences. See e.g.
97170., 97170.`5, 97170.`4
.â J. M. is somewhat okay.â¦
3 hours ago
I suspect the message formatting is using the same thresholds as
NumberForm
.â Daniel Lichtblau
2 hours ago