squiggle/packages/website/docs/Api/Number.mdx

161 lines
1.5 KiB
Plaintext
Raw Permalink Normal View History

2022-06-05 20:59:45 +00:00
---
2022-06-11 00:35:48 +00:00
sidebar_position: 9
2022-06-05 20:59:45 +00:00
title: Number
---
2022-06-14 23:47:31 +00:00
Squiggle `numbers` are Javascript floats.
2022-06-14 23:12:29 +00:00
Many of the functions below work on lists or pairs of numbers.
import TOCInline from "@theme/TOCInline";
<TOCInline toc={toc} />
2022-06-05 20:59:45 +00:00
### ceil
2022-06-14 01:13:43 +00:00
```
ceil: (number) => number
2022-06-05 20:59:45 +00:00
```
### floor
2022-06-14 01:13:43 +00:00
```
floor: (number) => number
2022-06-05 20:59:45 +00:00
```
### abs
2022-06-14 01:13:43 +00:00
```
abs: (number) => number
2022-06-05 20:59:45 +00:00
```
### round
2022-06-14 01:13:43 +00:00
```
round: (number) => number
2022-06-05 20:59:45 +00:00
```
## Statistics
2022-06-05 20:59:45 +00:00
### max
2022-06-14 01:13:43 +00:00
```
2022-06-11 00:35:48 +00:00
max: (list<number>) => number
2022-06-05 20:59:45 +00:00
```
### min
2022-06-14 01:13:43 +00:00
```
2022-06-11 00:35:48 +00:00
min: (list<number>) => number
2022-06-05 20:59:45 +00:00
```
### mean
2022-06-14 01:13:43 +00:00
```
2022-06-11 00:35:48 +00:00
mean: (list<number>) => number
2022-06-05 20:59:45 +00:00
```
2022-07-20 03:52:08 +00:00
### geometric mean
```
geomean: (list<number>) => number
```
2022-06-11 00:35:48 +00:00
### stdev
2022-06-05 20:59:45 +00:00
2022-06-14 01:13:43 +00:00
```
2022-06-11 00:35:48 +00:00
stdev: (list<number>) => number
2022-06-05 20:59:45 +00:00
```
### variance
2022-06-14 01:13:43 +00:00
```
2022-06-11 00:35:48 +00:00
variance: (list<number>) => number
2022-06-05 20:59:45 +00:00
```
## Algebra
2022-06-05 20:59:45 +00:00
### unaryMinus
2022-06-14 01:13:43 +00:00
```
unaryMinus: (number) => number
2022-06-05 20:59:45 +00:00
```
### equal
2022-06-14 01:13:43 +00:00
```
equal: (number, number) => boolean
2022-06-05 20:59:45 +00:00
```
### add
2022-06-14 01:13:43 +00:00
```
add: (number, number) => number
2022-06-05 20:59:45 +00:00
```
### sum
2022-06-14 01:13:43 +00:00
```
2022-06-11 00:35:48 +00:00
sum: (list<number>) => number
```
### cumulative sum
```
cumsum: (list<number>) => list<number>
2022-06-05 20:59:45 +00:00
```
### multiply
2022-06-14 01:13:43 +00:00
```
multiply: (number, number) => number
2022-06-05 20:59:45 +00:00
```
### product
2022-06-14 01:13:43 +00:00
```
2022-06-11 00:35:48 +00:00
product: (list<number>) => number
```
### cumulative product
```
cumprod: (list<number>) => list<number>
2022-06-05 20:59:45 +00:00
```
2022-07-20 03:52:08 +00:00
### diff
```
diff: (list<number>) => list<number>
```
2022-06-05 20:59:45 +00:00
### subtract
2022-06-14 01:13:43 +00:00
```
subtract: (number, number) => number
2022-06-05 20:59:45 +00:00
```
### divide
2022-06-14 01:13:43 +00:00
```
divide: (number, number) => number
2022-06-05 20:59:45 +00:00
```
### pow
2022-06-14 01:13:43 +00:00
```
pow: (number, number) => number
2022-06-05 20:59:45 +00:00
```
### exp
2022-06-14 01:13:43 +00:00
```
exp: (number) => number
2022-06-05 20:59:45 +00:00
```
### log
2022-06-14 01:13:43 +00:00
```
log: (number) => number
2022-06-11 15:57:02 +00:00
```