Why reinvent the wheel? These snippets are freely shared for math educators to use within their Just BASIC programs. If you have a reliable snippet for math functions, please consider sharing.

Basic Math functions include snippets for Addition, Subtraction, Multiplication, Division, Fractions, Decimals, etc.

Finding the Least Common Multiple
Snippet using a Gosub

n1 =8
n2 =6
Print n1, n2
Gosub[LCM]
Print "LCM = ";LCM
End[LCM]For i = n1 * n2 to2Step-1If i Mod n1 =0ThenIf i Mod n2 =0Then
LCM = i
EndIfEndIfNext i
Return

Snippet using a Function

n1 =4
n2 =6
Print n1, n2
Print "LCM = ";LCM(n1, n2)EndFunction LCM(n1, n2)For i = n1 * n2 to2Step-1If i Mod n1 =0ThenIf i Mod n2 =0Then
LCM = i
EndIfEndIfNext i
EndFunction

## Math Snippets

Why reinvent the wheel? These snippets are freely shared for math educators to use within their Just BASIC programs. If you have a reliable snippet for math functions, please consider sharing.

## Table of Contents

Finding Least Common MultipleHow to draw a circle with 2 different functionsFinding the Area of a Rectangle## Basic Math

Basic Math functions include snippets for Addition, Subtraction, Multiplication, Division, Fractions, Decimals, etc.Finding the Least Common MultipleSnippet using a Gosub

Snippet using a Function