Post Reply 
Convert(n,base,k)
04-12-2021, 04:11 AM
Post: #1
Convert(n,base,k)
In the manual, it discussed use of the function

Code:

convert(123,base,8)

To convert between integer bases. However I’ve noticed a lot of weird behavior of this function, and maybe functions generally, that I’m really struggling to wrap my head around.

For one, this function seems to only work in the CAS. On the Home Screen, it always returns “bad argument type”.

For another, it only works in the CAS if you type in “convert” with the alpha keys. If you choose convert from the Units->Tools menu (where this function is discussed in the manual) you get bad argument type. Even from the catalog it is bad argument type.

Thirdly, you must type “convert” in lowercase. But after you type it, it will appear in the history in uppercase. If you copy the history to the entry line, it will become lowercase again.

A fourth question seems to be whether “base” is given as a bare string in the above example, or if you quote it like

Code:

convert(123,”base”,8)

In the latter case, it suddenly starts working after all in the Home Screen and in the units menu. However, if you type it in lowercase in CAS with the alpha keys you now get “bad argument value”, which is presumably different than the bad argument “type”.

There must be some method to this madness, but I can’t for the life of me imagine what it is.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)