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

Echo number without scientific notation, while removing trailing zeros and decimal points

This: function output($x) { return (float)($x==0 ? '0' : rtrim(($x<0 ? rtrim(sprintf('%.8F', $x), "0") : $x), ".")); } echo output(0.00008659); Outputs: 8.659E-5 I want it to output this: 0.00008659 The reason why I'm using all those…
user2536244
-1
votes
2 answers

VBA Round() function always returns zero when input is in scientific notation

I have a strange issue with the Round() VBA function. When I try rounding any input in scientific notation it always returns zero: ? Cells(3, 34).Value 8,77796901893289E-02 ? Round(Cells(3, 34).Value, 0) 0 ? Round(8.777, 0) 9 Any clues how to make…
Vladimir
  • 3
  • 2
-1
votes
3 answers

Unexpected exception thrown by Convert.ToDecimal

This is probably an old one but I can't find anything on it. Does anyone have any idea why this: Convert.ToDecimal("3.14521963414679E-08") throws FormatException ("Input string was not in a correct format.") However this works as…
John Reilly
  • 5,791
  • 5
  • 38
  • 63
-1
votes
1 answer

Displaying a scientific notation double in a more readable format

I am reading in a value from a PLC via a third party library, however when saved as a double the value appears to be in scientific notation. The value in the PLC is 1.234 however, when debugging the application, the value being stored in the double…
Gavin Coates
  • 1,366
  • 1
  • 20
  • 44
-2
votes
1 answer

Removing scientific notation format from character column type

I have an issue where I have a column in a dataframe that is a character type as there is text in it so I cannot force it to be numeric. But I also have values that show up as scientific notation that I would like to convert and remove the…
megmac
  • 547
  • 2
  • 11
-2
votes
1 answer

Java E/Scientific Notation gets lost in GET Request

i have a spring boot application which returns a Response Entity that holds a double value (0.00010). Since this is mapped to 1.0E-4, i would like to get 1.0E-4. Instead, i get 0.00. Is it possible that the Response Entity of a GET Request is not…
tdog
  • 27
  • 1
  • 5
-2
votes
2 answers

Having trouble writing an equation with scientific notation and exponents in Python

I am having some trouble writing this equation in Python and having it produce correct results: y = 2.95710^-7 * x^4 – 2.34310^-5 * x^3 – 1.67*10^-4 * x^2 + 0.04938 * x – 1.083. I have tried the following code: y = 0.0000002957*x**4 -…
-2
votes
1 answer

Is there anything special about the number 308?

So one day I was experimenting (like any other good coder does), and I came up across this: >>> 1e308 1e+308 >>> 1e309 inf What is going on? First of all, 308’s factors are 2, 2, 7, and 11. Farther investigation yields: >>>…
Einsteinium
  • 94
  • 13
-2
votes
1 answer

convert numbers in scientific notation to decimal

Write a C program to convert a number in scientific notation to its equivalent decimal form : Given 8.3e+2 output = 830 2.E-1 output = 0.2 4.3E2 output = 430 Is there any inbuilt library or function in C/C++ which can do this? or one will…
pensee
  • 1
  • 1
-2
votes
1 answer

Remove decimal point from any arbitrary decimal number

I am writing Python3 code which requires me to simpy remove the decimal. I tried the most simple thing I could think of num = int(str(float(x)).replace('.', '')) where x is generated using x = a*x*(1-x) where both a and x are float but when the…
-2
votes
2 answers

Does C have functions that can test if value is within tolerance of an expected value, if not how do I create one?

I am new to C and recently I had an interesting assignment fooling around with scientific numbers. The assignment was to implement several functions that convert weight units to others and later compare different weight units to each other. My code…
Grey_dev1997
  • 77
  • 1
  • 6
-2
votes
1 answer

Correctly display scientific notation in c++

#include #include using namespace std; int main() { long double n; cin>>n; cout<
lolplayer
  • 21
  • 1
  • 2
-2
votes
2 answers

Can I set a variable that will change the floatfield when using cout?

I want to be able to easily change the floatfield from scientific to fixed dependent on a condition, so my result would change from something like 3.000000e+00 to 3.0, using code that might look something like this: some_datatype floatfield; float…
David
  • 63
  • 5
-2
votes
1 answer

I am trying to remove exponential numbers from the results

Help! I am completely new to coding as you can see...lol I need help removing the scientific notation that my code outputs. I would like the results to be displayed as only real numbers...i.e (removing the "e")...I would like to show only maybe 2-4…
Tae Tar
  • 1
  • 1
-2
votes
1 answer

Control the number of decimals in scientific notation

I have a vector: c(0, 1.23, 0.0000123) and I would like to get scientific notation defining the number of decimals. Something like: # [1] 0.000e+00 1.230e+00 1.230e-05 or like: # [1] 0.000000e+00 1.230000e+00 1.230000e-05 How can I do that?
1 2 3
45
46