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
11
votes
1 answer

Convert double to scientific notation with specific number after decimal points

I want to convert double to scientific notation like this: -0.00752382528 => -.752383E-1 can i do this with .ToString() or Regex?
user2089789
11
votes
3 answers

Formatting n significant digits in C++ without scientific notation

I want to format a floating point value to n significant digits but never using scientific notation (even if it would be shorter). The format specification %f doesn't deal in significant digits, and %g will sometimes give me scientific notation…
PeteC
  • 1,047
  • 9
  • 15
11
votes
2 answers

Stopping a large number of zeros being printed (not scientific notation)

What I'm trying to achieve is to have all printed numbers display at maximum 7 digits. Here are examples of what I want printed: 0.000000 (versus the actual number which is 0.000000000029481.....) 0.299180 (versus the actual number which is…
Jase
  • 1,025
  • 1
  • 9
  • 34
10
votes
0 answers

newtonsoft json.net disable scientific notation

I would like my webapi to serialize json using camelcase. So i added the following to Global.asax. HttpConfiguration config = GlobalConfiguration.Configuration; config.Formatters.JsonFormatter.SerializerSettings.ContractResolver =…
M F
  • 161
  • 1
  • 4
10
votes
3 answers

Pitfalls with using scientific notation in JavaScript

This question is not seeking developer code formatting opinions. Personally, I prefer to use scientific notation in my JS code when I can because I believe it is more readable. For me, 6e8 is more readable than 600000000. That being said, I am…
Evan Wieland
  • 1,445
  • 1
  • 20
  • 36
10
votes
3 answers

Javascript parseFloat '1.23e-7' gives 1.23e-7 when need 0.000000123

parseFloat(1.51e-6); // returns 0.00000151 parseFloat(1.23e-7); // returns 1.23e-7 // required 0.000000123 I am sorting table columns containing a wide range of floating-point numbers, some represented in scientific notation. I am using the jQuery…
shanesolo
  • 141
  • 1
  • 1
  • 6
10
votes
2 answers

(PHP) How to avoid scientific notation and show the actual large numbers?

I have been working with the PHP code that the expected result will become : 1 101 10001 1000001 100000001 10000000001 1000000000001 100000000000001 10000000000000001 1000000000000000001 finally the output was : 1 101 …
Herry Kusmadi
  • 1,281
  • 3
  • 12
  • 13
9
votes
3 answers

scientific notation's type

int s = 1e9; What is type of 1e9 and how precise is it? (Is it exactly equal to 1000000000?) Printing type of a value/variable to stdout would be useful if it's possible.
a-z
  • 1,634
  • 4
  • 16
  • 35
9
votes
3 answers

Convert scientific notation to float when using OpenRowSet to import a .CSV file

I am using openrowset to import a csv file into SQL Server. One of the columns in the csv file contains numbers in scientific notation (1.08E+05) and the column in the table it is being inserted By default it is importing the value as 1 and…
amarcy
  • 1,485
  • 2
  • 19
  • 28
9
votes
5 answers

Opposite of Number.toExponential in JS

I need to get the value of an extremely large number in JavaScript in non-exponential form. Number.toFixed simply returns it in exponential form as a string, which is worse than what I had. This is what Number.toFixed returns: >>> x =…
Oz.
  • 5,299
  • 2
  • 23
  • 30
9
votes
3 answers

Format model display in texreg or stargazer R as scientific

I just ran a statisitical model and i want it to display the results of the model as a table using stargazer. However, the large numbers are displayed in full. fit2<-lm(A~B,data=C) stargazer(fit2,type="text") With this table as…
Joke O.
  • 515
  • 6
  • 29
9
votes
2 answers

How can I convert between scientific and decimal notation in Perl?

I know this is a total newbie question, but the answer may not be obvious to many new programmers. It wasn't initially obvious to me so I scoured the Internet looking for Perl modules to do this simple task.
Kurt W. Leucht
  • 4,725
  • 8
  • 33
  • 45
9
votes
3 answers

Extract scientific number from string

I am trying to extract scientific numbers from lines in a text file. Something like Example: str = 'Name of value 1.111E-11 Next Name 444.4' Result: [1.111E-11, 444.4] I've tried solutions in other posts but it looks like that only works for…
Josh Melson
  • 91
  • 1
  • 1
  • 2
8
votes
1 answer

Extracting the exponent from scientific notation

I have a bunch of numbers in scientific notation and I would like to find their exponent. For example: >>> find_exp(3.7e-13) 13 >>> find_exp(-7.2e-11) 11 Hence I only need their exponent ignoring everything else including the sign. I have looked…
Eilleen
  • 357
  • 1
  • 16
8
votes
3 answers

How to capture minus sign in scientific notation with regex?

I was trying to answer a question (that later got deleted) that I think was asking about extracting text representations of scientific notation. (Using R's implementation of regex that requires double escapes for meta-characters and can be used in…
IRTFM
  • 258,963
  • 21
  • 364
  • 487