@taishira/calculator@0.0.3Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
taishira/calculatorIt is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
JSR Score
88%
Published
3 weeks ago (0.0.3)
Calculator
Use calculator
to perform basic arithmetic operations.
Functions
The calculator
module provides the following functions:
add
Adds two numbers.
function add(a: number, b: number): number
Parameters
a
: The first number.b
: The second number.
Returns
The sum of a
and b
.
subtract
Subtracts the second number from the first number.
function subtract(a: number, b: number): number
Parameters
a
: The first number.b
: The second number.
Returns
The difference between a
and b
.
multiply
Multiplies two numbers.
function multiply(a: number, b: number): number
Parameters
a
: The first number.b
: The second number.
Returns
The product of a
and b
.
divide
Divides the first number by the second number.
function divide(a: number, b: number): number
Parameters
a
: The first number.b
: The second number.
Returns
The quotient of a
divided by b
.
Throws
Error
ifb
is 0 (division by zero is not allowed).
square
Squares a number.
function square(x: number): number
Parameters
x
: The number to be squared.
Returns
The square of x
.
License
MIT
Built and signed on
View transparency logGitHub Actions
Add Package
deno add jsr:@taishira/calculator
Import symbol
import * as mod from "@taishira/calculator";
---- OR ----
Import directly with a jsr specifier
import * as mod from "jsr:@taishira/calculator";
Add Package
npx jsr add @taishira/calculator
Import symbol
import * as mod from "@taishira/calculator";
Add Package
yarn dlx jsr add @taishira/calculator
Import symbol
import * as mod from "@taishira/calculator";
Add Package
pnpm dlx jsr add @taishira/calculator
Import symbol
import * as mod from "@taishira/calculator";
Add Package
bunx jsr add @taishira/calculator
Import symbol
import * as mod from "@taishira/calculator";