Greater than 32bit binary conversion. - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: Greater than 32bit binary conversion. (/thread-18363.html) |
Greater than 32bit binary conversion. - matalog - 05-14-2022 02:17 PM I want to convert any binary number of lets say less than 512 bit, to a base 20 integer. Is there a way to do that with some built in features of the calculator as is, or does it need a program? I have written a little program anyway, that will take in any length of a binary number in string format, but I do not know how to convert it to a number that can retain a large amount of digits. Is there a CAS command or function that will allow that? Code: EXPORT B2D(A) If you run this as : B2D("10110110110"), then it will return 1,426. But if you enter a larger binary number, then the amount of digits will get truncated to 12 with an E45, for example, at the end, and therefore numbers will be lost. I would like the number output (or string I suppose) to be as large as it has to be, to house every piece of information that the binary number contained. It would be best if it was a number form, so that it could then be further manipulated. Is there a was to force CAS level number sizes, and accuracy of upwards of 90 base 10 digits? RE: Greater than 32bit binary conversion. - parisse - 05-15-2022 05:43 AM In CAS, type 0b10110110110 RE: Greater than 32bit binary conversion. - matalog - 05-15-2022 01:05 PM That's great. Is there a way to achieve CAS length numbers from a program? RE: Greater than 32bit binary conversion. - Stevetuc - 05-15-2022 01:44 PM (05-15-2022 01:05 PM)matalog Wrote: That's great. Something like this? long() run from the cas screen will return 70368684086562 Code:
|