Questions tagged [scientific-notation]

Scientific notation is a way of writing numbers. In scientific notation, all numbers are written in the form of a*10^b. In computing "E notation" is often used. It uses "E" or "e" letter instead of "*10^".

Scientific notation is a way of writing numbers that are too big or too small to be conveniently written in decimal form. Scientific notation has a number of useful properties and is commonly used in calculators and by scientists, mathematicians and engineers.

In scientific notation all numbers are written in the form of a*10^b, where a(mantissa) is a real number and b(exponent) is an integer.

There are different subtypes of this notation. E notation is often used in computing. It uses E or e letter instead of *10^. Note: in this usage the character e is not related to the mathematical constant e or the exponential function e^x

Some examples:

Standard deciaml | Normalized scientific | E (upper) | e (lower)
-----------------+-----------------------+-----------+----------
              30 |                3x10^1 |       3E1 |       3e1         
         1,538.1 |           1.5381x10^3 |  1.5381E3 |  1.5381e3         
     0.000 005 2 |           5.2x10^(-6) |    5.2E-6 |    5.2e-6         
            -0.2 |            -2x10^(-1) |     -2E-1 |     -2e-1         
683 questions
17
votes
2 answers

String in scientific notation C++ to double conversion

I've got a database filled up with doubles like the following one: 1.60000000000000000000000000000000000e+01 Does anybody know how to convert a number like that to a double in C++? Is there a "standard" way to do this type of things? Or do I have…
miya
  • 1,059
  • 1
  • 11
  • 20
16
votes
2 answers

Scientific Notation in C#

How do I assign a number that is in scientific notation to a variable in C#? I'm looking to use Plancks Constant which is 6.626 X 10-34 This is the code I have which isn't correct: Decimal PlancksConstant = 6.626 * 10e-34;
Justin
  • 357
  • 2
  • 7
  • 18
16
votes
3 answers

Java: Why can't I declare integer types using scientific notation?

I can easily read 2e15 as "two quadrillion" at a glance, but for 2000000000000000 I have to count the zeroes, which takes longer and can lead to errors. Why can't I declare an int or long using a literal such as 2e9 or 1.3e6? I understand that a…
odougs
  • 175
  • 1
  • 1
  • 6
15
votes
4 answers

Why was the pattern string not followed in this code?

When following code is executed: DecimalFormat eNotation1 = new DecimalFormat("#0.###E0"); System.out.println(eNotation1.format(123.456789)); My expected output is; 1.235E2 instead, 1.2346E2 was printed. Why was the output 1.2346E2? I…
Satellite Sage
  • 440
  • 1
  • 4
  • 13
15
votes
2 answers

How to represent scientific notation in C

How do I represent extremely large or small numbers in C with a certain amount of significant figures. For example, if I want to do calculations on 1.54334E-34, how could I do this. Also, is this applicable to OpenCL code?
user1876508
  • 12,864
  • 21
  • 68
  • 105
14
votes
2 answers

How to stop doubles converting to scientific notation when using a stringstream

I'm making a function to return the number of decimal and whole number digits and am converting the inserted typename number to a string using sstreams. However the number when being converted to a string comes out in scientific notations which is…
Griffin
  • 2,399
  • 7
  • 48
  • 83
14
votes
2 answers

matlab matrix scientific notation

I've wondered about this for a while now. When Matlab prints the matrix A, for instance, with A it sometimes appears in scientific notation such as A = 1.0e+03 * 0 0 0.0070 0.0080 0.0030 0.0010 0 …
Hanmyo
  • 543
  • 4
  • 8
  • 18
13
votes
5 answers

Disable scientific notation in python json.dumps output

json.dumps outputs small float or decimal values using scientific notation, which is unacceptable to the json-rpc application this output is sent to. >>> import json >>> json.dumps({"x": 0.0000001}) '{"x": 1e-07}' I want this output instead: '{"x":…
Dust
  • 233
  • 2
  • 6
13
votes
5 answers

Is scientific notation interpreted as int or float?

If I hardcode a number in my code using the scientific notation (e.g. 1e9) what will the type of that number be (int, long, float, double..)? When the significand or the exponent are floating point numbers it can't be an integer obviously, but what…
Jawap
  • 2,463
  • 3
  • 28
  • 46
13
votes
2 answers

JSON e and JSON E

On the JSON website here, it explains the different possibilities of JSON 'objects'. However, in the numbers section, these appear: e | e+ | e- | E | E+ | E- 1 - What do these represent? In searching for an answer, appears alot. 2 -…
chris Frisina
  • 19,086
  • 22
  • 87
  • 167
12
votes
3 answers

how to prevent numbers from showing up in scientific notations

We have a StreamBuffer class in which we haven't implemented std::fixed operations and I am trying to prevent number showing up in scientific notations. With my below code some numbers are getting shown in scientific notations. We want to avoid…
user1950349
  • 4,738
  • 19
  • 67
  • 119
12
votes
3 answers

How to display coefficients in scientific notation with stargazer

I want to compare the results of different models (lm, glm, plm, pglm) in a table in R using stargazer or a similar tool. However I can't find a way to display the coefficients in scientific notation. This is kind of a problem because the intercept…
Lukas Stäcker
  • 319
  • 3
  • 10
12
votes
5 answers

java (beginner) converting scientific notation to decimal

if double d = 1.999e-4 I want my output to be 0.0001999. How can I do it?
hibc
  • 267
  • 1
  • 5
  • 12
11
votes
5 answers

C++, scientific notation, format number

Is it possible to format string in scientific notation in the following ways: set fixed places in exponent: 1 set fixed decimal places in mantissa: 0 double number = 123456.789 So the number should be formated 1e+5 I am not able to set 0…
abcdef
  • 319
  • 2
  • 3
  • 11
11
votes
3 answers

R, Knitr, Rnw, beautiful scientific numbers

I would like that all numbers generated by my knitr codes don´t look like an oldfashioned calculator. Is there any option to get the numbers like the last one (with ·10 instead of e or E) ? options(scipen=...) doesn't seem to have that…
skan
  • 7,423
  • 14
  • 59
  • 96
1 2
3
45 46