You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Represent numbers as *char but store the actual bits in the char
Currently numbers are being stored as strings (eg [‘1’, ‘2’, ‘3’]=123) which takes more time to do calculations with that to be storing it like this [0x1, 0x24] = 1*(16^2)+2*(16^1)+4*(16^0).
Why *char?
I suggest using char because it is exactly 8 bits on all machines so the code is (mostly) the same for 64 bit and 32 bit machines.
The text was updated successfully, but these errors were encountered:
Hey, this change makes sense, but I've pretty much completed this project ATP, and changing something so major would take a lot of time and effort.
Interestingly, I was also experimenting with larger bases (2^32 or 2^64, which I think would be even better, or 10^19)
Anyway, one of the reasons (not that this justifies the slower speeds, just thought I'd state this for the sake of it) I chose to go with base-10 is because it was the easiest to code and debug. Also, when read in base-10, the operations would be precise to the exact decimal place you want them to be (which, like, yay!)
Represent numbers as *char but store the actual bits in the char
Currently numbers are being stored as strings (eg [‘1’, ‘2’, ‘3’]=123) which takes more time to do calculations with that to be storing it like this [0x1, 0x24] = 1*(16^2)+2*(16^1)+4*(16^0).
Why *char?
I suggest using char because it is exactly 8 bits on all machines so the code is (mostly) the same for 64 bit and 32 bit machines.
The text was updated successfully, but these errors were encountered: