squiggle/src/GuesstimatorDist.re

21 lines
627 B
ReasonML
Raw Normal View History

2020-02-06 21:05:13 +00:00
let normal = (mean: float, std: float) =>
Js.Float.(
{
let nMean = toPrecisionWithPrecision(mean, ~digits=4);
let nStd = toPrecisionWithPrecision(std, ~digits=2);
{j|normal($(nMean), $(nStd))|j};
}
);
2020-02-13 12:40:04 +00:00
let logNormal = (mean: float, std: float) => {
Js.Float.(
{
2020-04-01 18:49:59 +00:00
let nMean = toPrecisionWithPrecision(mean, ~digits=4);
let nStd = toPrecisionWithPrecision(std, ~digits=2);
{j|lognormal({mean: $(nMean), stdev: $(nStd)})|j};
2020-02-13 12:40:04 +00:00
}
);
};
2020-02-17 19:45:32 +00:00
let divide = (str1: string, str2: string) => {j|$(str1)/$(str2)|j};
let min = (str1: string, str2: string) => {j|min($(str1),$(str2))|j};