+ 35
[Python] What Is The Max Length Of Bytes Can Struct Pack ?
Sometimes I Try Big Integers With Struct Like 999999 And It Tells Me That This Is A Bad Char Or Something Like That So My Question Is What Is The Highest Integer Can Struct Pack In Python I Tried To Do Some for loop with a long range integers but that's almost impossible because it counts to a very very long range
16 Answers
+ 1
8 bytes = 8 * 8 bits = 64 bits. So a 64 digit binary number. Or, the 64-bit integer limit (2 ^ 63 - 1 in case of a long long).
+ 25
@Alper I Mean When You Do This
struct.pack("q",99999999999999999)
Error: Index Out If Range
So What Is The Maximum Integer That Can Struct Pack
+ 20
@LunarCoffee So How Much Can C Do ?
+ 19
@mglord ??
+ 18
@Alex[WEB-DEV] this is not my question
if you are sharing your code share it with the post "Show Your Codes Here" or "Let's Celebrate Your Day"
+ 17
@Murali Kumar
I Recommend You To Use Python Or HTML Also You Can Use This
https://www.sololearn.com/Discuss/624826/?ref=app
+ 15
It may help you, please check:
https://docs.python.org/3/library/struct.html
+ 15
@mlglord no problem
+ 15
do you mean 8 digits number @LunarCoffee ?
+ 7
computer= " Bytes Can Struct Pack"
print len(computer) :D
+ 5
#mlglord, it's just spamming, Please avoid it.
+ 1
oops sorry, my little brother must have done that
+ 1
Probably as much as C can do.
+ 1
I mean, a standard long long "packing" would be 8 bytes. There's a table in the documentation for struct.
+ 1
Hello People Here, I'm a mechanical guy and wants to get in to it sector.....Can anyone suggest me the write way to move into the courses I should learn?