Create an account on the HP Community to personalize your profile and ask a question
01-21-2020 08:44 AM
i noticed on HP Prime simulator software on Windows that, if i change numeric base on settings (i.e. binary),
if on screen i write for example "4", it results "4" and not "100b" .....
If i write "2+2" it results "4" instead of "100b" .
I think it's not normal. If it's normal, changing base would be totally useless...
i tried it ONLY on a simulator on windows, i ask you if runs correct on real HP Prime, cause i need to buy it.
Thanks in advance
01-21-2020 11:45 AM - edited 01-21-2020 11:49 AM
Regardless of the default base that you set, you still have to tell Prime that your inputs are binary integers (where "binary integer" means "an integer in the currently selected base"). Numbers typed as plain numbers are never taken to be binary integers. The way you indicate binary integers is different in Home view and in CAS view, as follows:
In Home view, all binary integers must be preceded by the "#" character (ALPHA 3). For example, #1 means "1 in the current base". If you want to type a binary integer in some base other than the currently selected base, you can do so by typing a letter at the end of the number. For example, #99h means "the hex number 99" regardless of the current base setting. The letter must be lowercase. The options are self-explanatory: "b" for binary, "o" for octal, "d" for decimal. and "h" for hex.
CAS view does not support binary integers as objects the way Home view does, but you can still input and output them in several ways. If you preface a number by "0x" (without the quotes), it will be understood to be a hex number, and automatically converted to decimal. Example: Type 0x99 and press Enter, and you get 153, which is the decimal equivalent of "99" in hex. Conversely, the hex() function converts decimal numbers to hex. Example: hex(153) returns "0x99". The prefix "0b" means "here comes a binary number", and the bin() function converts decimal to binary.
Please note that the "default base" used in Home view must be set in Home Settings, not in CAS Settings. The "Integers" setting in CAS Settings is currently not used by CAS. It is reserved for possible future implementation. Therefore you may ignore that setting, since Prime ignores it too.
There are many other methods for entering and converting numbers to and from various bases, but the above will at least get you started. The Prime User Guide describes how to use the powerful "Edit Integer" application that's built-in (just put any binary integer on the stack in Home view, and then press Shift Minus). Please feel free to follow up with any further questions that you may have.
Disclaimer: I don't work for HP. I'm just another happy HP calculator user.
01-21-2020 01:08 PM
thanks Joe, understood!!
MMMh...working so differently from TI.... it's a little "hard"..
i try to explain: on a TI, once i choosed i.e. "binary base" and i digit "2+2", it results "100b".
Simple and easy.. here it results..4 and no way to use "edit integer feature" with shift minus: i have to digit: "#2d +#2d" , it results: "#4d" and ONLY here, i can use conversion via "edit integer"....
Was simpler if once choosed a base...system will operate conversion of the result automatically??
Too many walks for doing a thing who can be simpler by other manufacturers....
01-21-2020 02:27 PM
Please be aware of the good reason for the way HP does this. TI and Casio and almost everybody other than HP have a "Base Mode" which, as you say, requires fewer keystrokes to convert between bases and get math done in various bases. But doing it that way has one severe drawback that HP users cannot tolerate, namely, when you're in Base Mode, you can ONLY work with integers, and many built-in functions don't work in that mode. Then, when you exit Base Mode, you have NO access to any of the base conversions. Doing it that way makes you choose between doing ONLY base work, or NO base work at all. The HP way doesn't force any "base mode" upon you. You just do all your math the way you always do, using all the built-in functions. Then, any time you want to convert any of those results to something other than decimal, you can, without changing modes and losing everything you've done up to that point. In CAS, you can insert a hex number right in the middle of a hairy mathematical expression. No TI or Casio or Sharp allows this. The power of doing it this way far outstrips the few extra keystrokes that are required to avoid ambiguity.
Disclaimer: The above was my opinion when I wrote it, but it might no longer be my opinion by time you read it, because I enjoy learning and sometimes that requires opinions to change. 🙂