2

Hi I know that to print a number in a scientific notation I can do the following

"%.3e" % 123.456

will give

1.234e+02

however how can I obtain

12.34e+01?
13
  • 4
    12.34e+01 is not scientific notation, what rules are you trying to accomplish when displaying numbers? Commented Aug 22, 2016 at 23:54
  • given digits a b c d e f g h I would like to get the following transformation: 0.abcdefgh -> 0.abc e+00 a.bcdefgh -> a.bcd e+00 ab.cdefgh -> ab.cde e+00 abc.defgh -> ab.cde e+01 abcd.efgh -> ab.cde e+02 abcde.fgh -> ab.cde e+03 Commented Aug 23, 2016 at 0:10
  • 1
    How do you determine when to use 2 as the exponent? Commented Aug 23, 2016 at 0:11
  • Also, your last example doesn't look correct. Commented Aug 23, 2016 at 0:12
  • yes sorry, you're right Commented Aug 23, 2016 at 0:12

1 Answer 1

3

For clarification, most usages of Scientific Notation refers to Normalized Notation which requires that the leading number be at least 1 but less than 10. In Engineering Notation, the exponent is a multiple of three. These are the two most commonly used versions of Scientific Notation.

Sign up to request clarification or add additional context in comments.

1 Comment

Not precisely an answer, but too important a clarification to bury in the comments, so I guess it had better stay where it is.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.