API
Number
Squiggle numbers are Javascript floats.
Constants
Variable Name | Number Name | Value |
---|---|---|
Number.minValue | The smallest positive numeric value representable in JavaScript | 5e-324 |
Number.maxValue | The largest positive numeric value representable in JavaScript | 1.7976931348623157e+308 |
Functions
Comparison
smaller
infix: <
Namespace optional
Number.smaller(Number, Number) => Bool
larger
infix: >
Namespace optional
Number.larger(Number, Number) => Bool
smallerEq
infix: <=
Namespace optional
Number.smallerEq(Number, Number) => Bool
largerEq
infix: >=
Namespace optional
Number.largerEq(Number, Number) => Bool
Algebra (Number)
add
infix: +
Namespace optional
Number.add(Number, Number) => Number
subtract
infix: -
Namespace optional
Number.subtract(Number, Number) => Number
multiply
infix: *
Namespace optional
Number.multiply(Number, Number) => Number
divide
infix: /
Namespace optional
Number.divide(Number, Number) => Number
pow
infix: ^
Namespace optional
Number.pow(Number, Number) => Number
mod
modulo. This is the same as the '%' operator in Python. Note that there is no '%' operator in Squiggle for this operation.
Namespace optional
Number.mod(Number, Number) => Number
mod(10, 3)
mod(-10, 3)
mod(10, -3)
Functions (Number)
unaryMinus
unary: -
Namespace optional
Number.unaryMinus(Number) => Number
exp(3.5)
exp
exponent
Namespace optional
Number.exp(Number) => Number
exp(3.5)
log
Namespace optional
Number.log(Number) => Number
log(3.5)
log10
Namespace optional
Number.log10(Number) => Number
log10(3.5)
log2
Namespace optional
Number.log2(Number) => Number
log2(3.5)
floor
Namespace optional
Number.floor(Number) => Number
floor(3.5)
ceil
Namespace optional
Number.ceil(Number) => Number
ceil(3.5)
abs
absolute value
Namespace optional
Number.abs(Number) => Number
abs(3.5)
round
Namespace optional
Number.round(Number) => Number
round(3.5)
Algebra (List)
sum
Namespace optional
Number.sum(List(Number)) => Number
sum([3,5,2])
product
Namespace optional
Number.product(List(Number)) => Number
product([3,5,2])
cumprod
cumulative product
Namespace optional
Number.cumprod(List(Number)) => List(Number)
cumprod([3,5,2,3,5])
diff
Namespace optional
Number.diff(List(Number)) => List(Number)
diff([3,5,2,3,5])
Functions (List)
min
Namespace optional
Number.min(List(Number)) => Number
Number.min(Number, Number) => Number
min([3,5,2])
max
Namespace optional
Number.max(List(Number)) => Number
Number.max(Number, Number) => Number
max([3,5,2])
mean
Namespace optional
Number.mean(List(Number)) => Number
mean([3,5,2])
quantile
Namespace optional
Number.quantile(List(Number), Number) => Number
quantile([1,5,10,40,2,4], 0.3)
median
Namespace optional
Number.median(List(Number)) => Number
median([1,5,10,40,2,4])
geomean
geometric mean
Namespace optional
Number.geomean(List(Number)) => Number
geomean([3,5,2])
stdev
standard deviation
Namespace optional
Number.stdev(List(Number)) => Number
stdev([3,5,2,3,5])
variance
Namespace optional
Number.variance(List(Number)) => Number
variance([3,5,2,3,5])
sort
Namespace optional
Number.sort(List(Number)) => List(Number)
sort([3,5,2,3,5])
Utils
rangeDomain
Number.rangeDomain(Number, Number) => Domain
Number.rangeDomain(5, 10)