Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 14
๐๐ข๐ข๐๐จ ๐๐ก๐๐ฒ๐๐ฅ The number you entered is very big. And as for a compiled and interpreted language like python. They normally act like calculators witbout exceeding an output number of length 16.
So when the number to output is greter than 16. It will start to be converted into exponential form to the power of 10
+ 17
its scientific notation ...
to represent number ...
1e+x
is 1*10^x
+ 10
its scientific notation ...
to represent number ...
1e+x
is 1*10^x.
+ 9
I hope this will help you ๐๐ข๐ข๐๐จ ๐๐ก๐๐ฒ๐๐ฅ ๐ค๐ค
10**50 = 1e+50
1/(10**50) = 1e-50
Since int has max capacity of 16 hence it cannot handle 15< digits
If it provides a decimal:
suppose
1.2345678987654e-50 is approximately equal to
1.2345678987654/(10**50)
+ 8
Python is writing the answer in scientific notation.
Google scientific notation for further details..
+ 5
๐๐ข๐ข๐๐จ ๐๐ก๐๐ฒ๐๐ฅ num1 = 7777......... is way bigger than 777. For a number as small as 777, it's okay. But the number in the code has a lot of 7s. Python instead of showing so many digits, shows it in the scientific form.
+ 5
๐๐ข๐ข๐๐จ ๐๐ก๐๐ฒ๐๐ฅ as much as I know, just like Python knows how 1 < 2, it might have a specific limit where it starts showing numbers in the scientific form. If the float (important thing, it happens only with floats. If you instead wrote num1//num2, it would show the full result) numeral > the limit, it shows it in the scientific form.
+ 5
๐๐ข๐ข๐๐จ ๐๐ก๐๐ฒ๐๐ฅ
yes ...it can be ...
but its not that large number .....
it doesn't matters btw ...
its just a number ...
maybe the representation is different...
its like that because the engineers making this language thought that it must be like that
+ 5
say if you are working on a data science project and you want to see a number ..
will it be good to see
1000000000000000000000000000000000
which wont even fit on screen....
and there are not a single number to deal with in that you may have millions of numbers ..
and if each gets printed like this then wouldn't it be annoying...
+ 5
That is called IEEE754 Double Precision Floating Point Notation with base 10.
Division for Python is always a Floating Point Operation(which is why C coders generally don't prefer Python). It always stores the result of a division as a float. Python exclusively uses the Double Precision Floating Point container for float.
The result you see is a conversion of that float to str in Python via the STDOUT buffer. The buffer can't handle character conversion for this value, so it uses the field conversation, converting the Exponent and Mantissa seperately then scaling it by 10.
Double : 0.<Mantissa>e+<Exponent>
Notation : <Mantissa x 10>e+<Exponent-1>
You can read about Double Precision Floating Point Notation hereโฆ
https://en.m.wikipedia.org/wiki/Double-precision_floating-point_format
+ 5
1.111111111111111e*290
+ 5
๐๐ข๐ข๐๐จ ๐๐ก๐๐ฒ๐๐ฅ there is no reason behind it. I may say that that is a standard for calculators. Not exceeding an output number of 16 is a standard set. And as you know calculators are also programmed so every programming language responds in the same way a calculator can respond.
Another feature you will find similar to calculators... you will see that they can not exceed a number output of exponent 10^99...
+ 4
Sorry, but I don't see any problem with the output.
7777...../7 = 111...... which can be written as 1.1111... * 10^something. Which is exactly what the output is
1.1111....e290
+ 4
๐๐ข๐ข๐๐จ ๐๐ก๐๐ฒ๐๐ฅ for example, let the output be float(11111..... about 100 times). It is important to note that it happens only with floats.
Python must be having a limit, maybe around (100 thousand).0 [just my guess]
So when printing to the screen, it will check, if the number is greater than the limit. In this case, yes, so it will print it in scientific form. Else, it will print in normal form.
+ 4
The number you enter is so big that why python convert the answer in scientific form.
+ 3
1.1ยนโตe+290
+ 3
๐๐ข๐ข๐๐จ ๐๐ก๐๐ฒ๐๐ฅ just because it is easier to read. As everything is an object in Python, and as what will be printed is defined in the __repr__ function of the object, the developers might have decided to return the number in exponential form when the number exceeded the length of 16
+ 3
The number you have entered is very big.So your answer is in scientific notation.
+ 2
If numbers become big, python uses scientific notation
+ 2
Python is a very advanced language compared to c or java. In not so advanced languages such as c or java, you have to specify the data type to bound the length of a data or number. But in python, there is no need for data type so if the output is very big or very small for the memory python will automatically try to fit the number in memory so the look of the number is changed in your answer as it is represented in scientific form.