Posts

Showing posts with the label Function Calculator

How to create a saving calculator.

Image
💰 How to Create a Saving Calculator Function (Installment Savings) Have you ever wondered:  “If I deposit $300 every month at 4% interest, how much will I have after one year?” In this post, we’ll learn how to build a Saving Calculator Function right inside your own programmable calculator app — so you can find the answer instantly without opening a bank app. 🧩 1. Understanding the Saving Formula The general formula for calculating the future value of monthly savings (ordinary annuity) is: FV = PMT × ((1 + r)^n - 1)/r where: PMT = monthly deposit r = monthly interest rate (annual rate ÷ 12 ÷ 100) n = number of months This version assumes the deposit is made at the end of each month, which is how most banks calculate regular savings plans. 💻 2. Creating the Function (End-of-Month Deposit) Here’s the SimpleMath code version for your programmable calculator: def saving(principal, annualRate, months){     var monthlyRate = annualRate / 12/ 100;     var total = p...

How to create math function that converts decimal number to binary format.

Image
Let's create a mathematical function that converts decimal to binary using the coding function of the function calculator . Copy the code below and paste it into the code window of the function calculator's factory page, click the run button to run the code, and click the save button to save the mathematical function. def toBinary(num) = toBinary((num−num%2)/2)*10+num%2; toBinary(0)=0; toBinary(1)=1; You can go back to the calculator page and press the F2 button to use the function you just created in your calculations as shown below. The above code is defined recursively. The result of the calculation is a decimal number consisting of 1 and 0, which looks like a binary number. In simple terms, the remainder of the given number divided by 2 is placed at the end of the number, and the binary quotient of the division by 2 is placed one digit higher than that. Convert binary to decimal This time we are going to create a math function that converts binary number to deci...