sample/math library
Functions
-
add(
int a, int b) → int - Adds two numbers
-
divide(
int a, int b) → double - Divides two numbers. Throws ArgumentError if b is zero.
-
factorial(
int n) → int - Calculates the factorial of a number. Throws for negative inputs.
-
isEven(
int number) → bool - Checks if a number is even
-
isPrime(
int number) → bool - Checks if a number is prime
-
multiply(
int a, int b) → int - Multiplies two numbers
-
subtract(
int a, int b) → int - Subtracts two numbers