squiggle/src/lib/FloatCdf.re

20 lines
557 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.(
{
let nMean = toPrecisionWithPrecision(Js.Math.log10(mean), ~digits=4);
let nStd = toPrecisionWithPrecision(std, ~digits=2);
{j|lognormal($(nMean), $(nStd))|j};
}
);
};
2020-02-06 21:05:13 +00:00
let divide = (str1: string, str2: string) => {j|$(str1)/$(str2)|j};