How to create math function that converts decimal number to binary format.
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...