Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the suffix e+number mean in python at the end of a float?

I use random.uniform(1,2**100) to produce random floats to the range (0,2**100). Some results are :

>>> random.uniform(1,2**100)
5.9798650563331964e+29
>>> random.uniform(1,2**100)
8.439133849811236e+29
>>> random.uniform(1,2**100)
1.1367823572756921e+30
>>> random.uniform(1,2**100)
6.467828850316163e+29
>>> random.uniform(1,2**100)
6.114089228136624e+29
>>> random.uniform(1,2**100)
5.8262139039159224e+29

I can't get the interpretation of e+29 at the end of each number.

like image 425
curious Avatar asked Dec 06 '22 09:12

curious


2 Answers

It's know as E notation, which is plain text representation of scientific notation.

1.234e+56 means 1.234 * 10**56 or in more human readable form 1.234 × 1056.

like image 51
vartec Avatar answered Apr 01 '23 09:04

vartec


"e+number" means 10 to the power of a positive number, in case of a negative number it would be like "e-number".

like image 30
Yazdan Kakaei Avatar answered Apr 01 '23 08:04

Yazdan Kakaei