squiggle/packages/website/docs/Api/Number.mdx
2022-07-19 20:52:08 -07:00

161 lines
1.5 KiB
Plaintext

---
sidebar_position: 9
title: Number
---
Squiggle `numbers` are Javascript floats.
Many of the functions below work on lists or pairs of numbers.
import TOCInline from "@theme/TOCInline";
<TOCInline toc={toc} />
### ceil
```
ceil: (number) => number
```
### floor
```
floor: (number) => number
```
### abs
```
abs: (number) => number
```
### round
```
round: (number) => number
```
## Statistics
### max
```
max: (list<number>) => number
```
### min
```
min: (list<number>) => number
```
### mean
```
mean: (list<number>) => number
```
### geometric mean
```
geomean: (list<number>) => number
```
### stdev
```
stdev: (list<number>) => number
```
### variance
```
variance: (list<number>) => number
```
## Algebra
### unaryMinus
```
unaryMinus: (number) => number
```
### equal
```
equal: (number, number) => boolean
```
### add
```
add: (number, number) => number
```
### sum
```
sum: (list<number>) => number
```
### cumulative sum
```
cumsum: (list<number>) => list<number>
```
### multiply
```
multiply: (number, number) => number
```
### product
```
product: (list<number>) => number
```
### cumulative product
```
cumprod: (list<number>) => list<number>
```
### diff
```
diff: (list<number>) => list<number>
```
### subtract
```
subtract: (number, number) => number
```
### divide
```
divide: (number, number) => number
```
### pow
```
pow: (number, number) => number
```
### exp
```
exp: (number) => number
```
### log
```
log: (number) => number
```