I am trying to condense 3 numbers, all of which lie within the range of -50 million to +50 million. How can I condense all 3 into a single number and then retrieve the 3 numbers again from un-condensing the single number.
For example if I have: -3000, 122, 103 will become a single number such as "9484010392"
Uncondensing "9484010392" will return [-3000, 122, 103]
The number 9484010392 is just chosen at random and serves no connection to the numbers in the example, it's just to clarify what I mean by a single condensed number.
etc.
P.S. Writing the program in Java :)
https://stackoverflow.com/questions/66937778/how-can-i-pack-3-digits-into-a-single-number-within-a-given-range April 04, 2021 at 11:27AM
没有评论:
发表评论