I see the dictionary says baseConvert can only handle numbers between zero and 4,294,967,295 (2^32 - 1).
The number 7909090520 is thus too large for baseConvert to handle. I guess I'll have to write my own function to convert larger numbers!
What does the number represent? Is it an actual quantity, or a decimal representation of byte values? If the latter, the binaryEncode and binaryDecode functions may help, since they can operate on a series of values in one pass, with lots of conversion options.
Richard Gaskin LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
FourthWorld wrote: Thu Dec 20, 2018 4:18 am
What does the number represent? Is it an actual quantity, or a decimal representation of byte values? If the latter, the binaryEncode and binaryDecode functions may help, since they can operate on a series of values in one pass, with lots of conversion options.
Kind of both. The number is an actual quantity calculated as the sum of four 32-bit integers, and only one of the four integers is the decimal representation of a 4-byte chunk of binary data. I'm trying to write a hashing algorithm.
But not to worry, as I don't actually need to convert the REAL sum of the four integers to its bit-representation. I only need the bit-representation of (theSum bitAnd 4294967295), which leaves a 32-bit integer. So the baseConvert function will work just fine.