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
370
votes
6 answers

How can I disable scientific notation?

I have a dataframe with a column of p-values, and I want to make a selection on these p-values. > pvalues_anova [1] 9.693919e-01 9.781728e-01 9.918415e-01 9.716883e-01 1.667183e-02 [6] 9.952762e-02 5.386854e-01 9.997699e-01 8.714044e-01…
Samantha
  • 3,785
  • 2
  • 15
  • 7
289
votes
4 answers

Force R not to use exponential notation (e.g. e+10)?

Can I force R to use regular numbers instead of using the e+10-like notation? I have: 1.810032e+09 # and 4 within the same vector and want to see: 1810032000 # and 4 I am creating output for an old fashioned program and I have to write a text…
Matt Bannert
  • 27,631
  • 38
  • 141
  • 207
273
votes
8 answers

Format / Suppress Scientific Notation from Pandas Aggregation Results

How can one modify the format for the output from a groupby operation in pandas that produces scientific notation for very large numbers? I know how to do string formatting in python but I'm at a loss when it comes to applying it here.…
247
votes
13 answers

Display a decimal in scientific notation

How can I display Decimal('40800000000.00000000000000') as '4.08E+10'? I've tried this: >>> '%E' % Decimal('40800000000.00000000000000') '4.080000E+10' But it has those extra 0's.
Greg
  • 45,306
  • 89
  • 231
  • 297
235
votes
4 answers

Suppress Scientific Notation in Numpy When Creating Array From Nested List

I have a nested Python list that looks like the following: my_list = [[3.74, 5162, 13683628846.64, 12783387559.86, 1.81], [9.55, 116, 189688622.37, 260332262.0, 1.97], [2.2, 768, 6004865.13, 5759960.98, 1.21], [3.74, 4062, 3263822121.39,…
donopj2
  • 3,933
  • 5
  • 23
  • 30
139
votes
2 answers

Prevent scientific notation

I have the following code: plt.plot(range(2003,2012,1),range(200300,201200,100)) # several solutions from other questions have not worked, including # plt.ticklabel_format(style='sci', axis='x', scilimits=(-1000000,1000000)) #…
Travis Osterman
  • 1,493
  • 2
  • 10
  • 4
105
votes
9 answers

How to make C++ cout not use scientific notation

double x = 1500; for(int k = 0; k<10 ; k++){ double t = 0; for(int i=0; i<12; i++){ t += x * 0.0675; x += x * 0.0675; } cout<<"Bas ana: "<
Yunus Eren Güzel
  • 3,018
  • 11
  • 36
  • 63
71
votes
2 answers

Forcing R output to be scientific notation with at most two decimals

I would like to have consistent output for a particular R script. In this case, I would like all numeric output to be in scientific notation with exactly two decimal places. Examples: 0.05 --> 5.00e-02 0.05671 --> 5.67e-02 0.000000027 -->…
user1830307
46
votes
4 answers

Parsing scientific notation sensibly?

I want to be able to write a function which receives a number in scientific notation as a string and splits out of it the coefficient and the exponent as separate items. I could just use a regular expression, but the incoming number may not be…
bugmagnet
  • 7,631
  • 8
  • 69
  • 131
42
votes
4 answers

Prevent scientific notation in ostream when using << with double

I need to prevent my double to print in scientific notation in my file, when I do this outfile << X;
DogDog
  • 4,820
  • 12
  • 44
  • 66
41
votes
4 answers

Converting number in scientific notation to int

Could someone explain why I can not use int() to convert an integer number represented in string-scientific notation into a python int? For example this does not work: print int('1e1') But this does: print int(float('1e1')) print int(1e1) #…
kezzos
  • 3,023
  • 3
  • 20
  • 37
41
votes
2 answers

Why do powers of 10 print in scientific notation at the 5th power?

I would like to know if and how the powers of 10 are related to the printing of scientific notation in the console. I've searched R docs and haven't found anything relevant, or that I really understand. First off, my scipen and digits settings…
Rich Scriven
  • 97,041
  • 11
  • 181
  • 245
40
votes
2 answers

How to express numbers in scientific notation in java?

I'm writing a program that deals with planets' mass and diameter; These quantities are expressed in scientific notation. My question is NOT, mind you, NOT how does one print large numbers the right way (That's using printf(), duh), its how I…
OrangeCalx01
  • 806
  • 2
  • 7
  • 21
39
votes
4 answers

Scientific notation colorbar

I am trying to put a colorbar to my image using matplotlib. The issue comes when I try to force the ticklabels to be written in scientific notation. How can I force the scientific notation (ie, 1x10^0, 2x10^0, ..., 1x10^2, and so on) in the ticks of…
Alejandro
  • 3,263
  • 2
  • 22
  • 38
33
votes
2 answers

Convert from scientific notation string to float in C#

What's the proper way to convert from a scientific notation string such as "1.234567E-06" to a floating point variable using C#?
odbasta
  • 515
  • 2
  • 7
  • 8
1
2 3
45 46