(12C) Modulo, the financial way - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (12C) Modulo, the financial way (/thread-21704.html) |
(12C) Modulo, the financial way - Postfix - 05-06-2024 07:19 PM The modulo operation, sometimes called the 5th basic operation, returns the remainder of an integer division. Normally it is calculated as a mod b = a - b×INT(a/b) which can be transformed into a program, in a rather conventional way: Code: 01 x<>y #t z b a On the other hand, as a financial calculator, we should be surprised if the HP12C wouldn't offer a financial way, too: Code: 01 f Clear FIN #clears all financial registers Usage: a ENTER b R/S Examples: 20 mod 7 = 6 200 mod 9 = 2 10 mod 6 = 4 40 mod 6 = 4 100 mod 6 = 4 1E9 mod 6 = 4 Have fun modulating numbers! (Summarised from my original post) |