Here is my problem:
If I try for example to print the result of :
2**64
will print:
18446744073709551616L
But now if I want to print the result of :
1.8446744*10**19
This will print:
1.8446744e+19
So my question is : how can I print the entire result of 1.8446744e+19 I want to see :
18446744000000000000
And what means the sign L at the end of my numbers ?
Use string formatting to set the format you want to display:
>>> print "%.0f" % (1.8446744*10**19)
18446744000000000000
First the L at the end of your number means the type is a 'long' you can check the type by:
>>> type(18446744000000000000)
long
Then to get your result not as a scientific notation you can just convert your number to a long:
>>> long(1.8446744*10**19)
18446744000000000000L
You can try to convert it as an int, python will automatically convert it as a long.
PS : This works only for python 2.2 and upper but not for python 3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With