Post Reply 
DB48X: HP48-like RPL implementation for DM42
Today, 12:15 AM
Post: #501
RE: DB48X: HP48-like RPL implementation for DM42
(Yesterday 05:07 PM)n1msr Wrote:  Until R->I is implemented on the DB48X, I was going to resort to using only Real Numbers is these programs, except that Comb[inations] won't use Real Numbers. I could of course do the nCr calculation using factorial (x!), where nCr = n! / (r! * (n-r)!). The DB48X factorial function will take both Real Integers and Real Numbers :-)

R->I is now implemented on dev.

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
Today, 12:21 AM
Post: #502
RE: DB48X: HP48-like RPL implementation for DM42
(Yesterday 09:47 PM)battlecoder Wrote:  
(Yesterday 05:07 PM)n1msr Wrote:  I did wonder if there is a setting I could make in the DB48X calculator to change the way the functions behave, i.e. accept Real Numbers as well as, or instead of Real Integers?

This is an interesting problem. I've not used the DB48X much (yet! waiting for a DM42n and overlay to arrive) but it could be implemented like some programming languages do; If a function expects a parameter of type T, but a parameter of type P is supplied, it would check if there's an straightforward conversion from P->T, and apply it automatically to the input.

RPL is a highly polymorphic language, where the exact conversions that are allowed are really per command, and not really consistent across HP models.

So in that context, any kind of implicit conversion is practically out of the question. This is even more true for conversions that would lose value, like decimal to integer. FIX, for example, accepts 2.3 as input, and truncates it to 2. FACT, on the other hand, does not truncate fractional input, and clearly should not.

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
Post Reply 




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