Calculator

A simple calculator class that provides basic arithmetic operations.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun add(a: Double, b: Double): Double

Adds two numbers.

Link copied to clipboard
fun divide(a: Double, b: Double): Double

Divides the first number by the second.

Link copied to clipboard

Multiplies two numbers.

Link copied to clipboard
fun power(base: Double, exponent: Double): Double

Calculates the power of a number.

Link copied to clipboard
fun sqrt(a: Double): Double

Calculates the square root of a number.

Link copied to clipboard

Subtracts the second number from the first.