Added key math variables, all lowercase
This commit is contained in:
parent
f01df95381
commit
2dc71315ef
|
@ -1,8 +1,23 @@
|
||||||
module Bindings = Reducer_Category_Bindings
|
module Bindings = Reducer_Category_Bindings
|
||||||
module Module = Reducer_Category_Module
|
module Module = Reducer_Category_Module
|
||||||
|
|
||||||
let m =
|
let availableNumbers: array<(string, float)> = [
|
||||||
Module.emptyModule->Module.defineNumber("pi", Js.Math._PI)->Module.defineNumber("e", Js.Math._E)
|
("pi", Js.Math._PI),
|
||||||
|
("e", Js.Math._E),
|
||||||
|
("ln2", Js.Math._LN2),
|
||||||
|
("ln10", Js.Math._LN10),
|
||||||
|
("log2e", Js.Math._LOG2E),
|
||||||
|
("log10e", Js.Math._LOG10E),
|
||||||
|
("sqrt2", Js.Math._SQRT2),
|
||||||
|
("sqrt1_2", Js.Math._SQRT1_2),
|
||||||
|
("phi", 1.618033988749895),
|
||||||
|
("tau", 6.283185307179586),
|
||||||
|
]
|
||||||
|
|
||||||
|
let mathBindings: Bindings.ExpressionT.bindings =
|
||||||
|
availableNumbers
|
||||||
|
->E.A2.fmap(((name, v)) => (name, ReducerInterface_ExpressionValue.EvNumber(v)))
|
||||||
|
->Belt.Map.String.fromArray
|
||||||
|
|
||||||
let makeBindings = (previousBindings: Bindings.t): Bindings.t =>
|
let makeBindings = (previousBindings: Bindings.t): Bindings.t =>
|
||||||
previousBindings->Bindings.defineModule("Math", m)
|
previousBindings->Bindings.defineModule("Math", mathBindings)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user