3 ms·
Commonly 65535 (for uint) :) A string of digits doth not an integer make.
by dogma1138 10y ago
Commonly 65535 (for uint) :)
A string of digits doth not an integer make.
- OJFord 10y agoMy point is - where do you think the problem is? > A string of digits doth not an integer make. The URL contains a string of digits as the order ID, if that's not where you think the problem is, where? > Commonly 65535 (for uint) Not in Python, as I said: > ... you don't have to be that careful (in simple scripts like this at least) for Python not to care how high you go.
- dogma1138 10y ago>The URL contains a string of digits as the order ID, if that's not where you think the problem is, where? A string of numbers != an integer, saying an integer in an ambiguous settings where for many people it's +-32K or 65K for unsigned often creates some confusion. Not in Python, as I said: > ... you don't have to be that careful (in simple scripts like this at least) for Python not to care how high you go. Python cares very much how high you go, Python sets a limit to integers also which is 2^31-1 for 32 bit and 2^63-1 for 64 bit runtimes. So even with Python if once you commonly go above 2147483647 you'll get into problems ;)
- OJFord 10y ago> A string of numbers != an integer I'm well aware. I'm just trying to understand where you think the problem is. > Python cares very much how high you go, Python sets a limit to integers also which is 2^31-1 for 32 bit and 2^63-1 for 64 bit runtimes. Try this: >>> print(f'Are you sure dogma? {2**128}') Are you sure dogma? 340282366920938463463374607431768211456 > So even with Python if once you commonly go above 2147483647 you'll get into problems ;) I didn't claim it never goes wrong. I said 'in simple scripts like this', I had a quick look after you expressed surprise that their orders fit into 'standard integers', and I didn't see anything that would impose such a restriction.
- dogma1138 10y agoThe fact that you can print a multiplication doesn't mean it's an integer :P Use sys.maxint / sys.maxsize =) 2147483647 is the limit for 32bit systems as I said, 2^63-1 is for a 64bit run time.
- OJFord 10y ago> The fact that you can print a multiplication doesn't mean it's an integer :P I mean, we're circling back on it on 'what do you mean by...' - and my basic point which is a lot of the time, especially for simple stuff like this, it's completely arbitrary. >>> print(int(2**128)) 340282366920938463463374607431768211456 You can tell me it "doesn't mean it's an integer" all you like, it's integer enough. Perhaps this whole thread would have been better summarised if I'd initially asked Where is it being stored as what you're terming a 'standard integer'? Edit - actually, I did ask that, in my second reply: > My point is - where do you think the problem is?
- dogma1138 10y agoAt this point I think it's a generational thing. When I hear Int i see -+32,767 even tho 4 Byte Ints were much more common for me :) And yes I know that the definition of an integer is any whole number including zero, but still some of us still think in datatypes. And since many (or most) languages still limit Int (at least by default) to 4 or 2 bytes that was what brought it up. And to some extent I see this problem every day that people define datatypes too casually like defining an interoperable interface with a datatype of Int and then pushing 340282366920938463463374607431768211456 through it without thinking about datatypes in different languages.