move log2 from composer to registered function
This commit is contained in:
parent
6f108f7f28
commit
c52e8f3b38
2 changed files with 4 additions and 3 deletions
|
|
@ -1110,7 +1110,6 @@ const COMPOSERS = {
|
|||
div: [numeralArgs((a, b) => a / b)],
|
||||
mod: [numeralArgs(_mod)],
|
||||
pow: [numeralArgs(Math.pow)],
|
||||
log2: [numeralArgs(Math.log2)],
|
||||
band: [numeralArgs((a, b) => a & b)],
|
||||
bor: [numeralArgs((a, b) => a | b)],
|
||||
bxor: [numeralArgs((a, b) => a ^ b)],
|
||||
|
|
@ -1816,6 +1815,8 @@ export const floor = register('floor', function (pat) {
|
|||
return pat.asNumber().fmap((v) => Math.floor(v));
|
||||
});
|
||||
|
||||
export const log2 = register('log2', (pat) => pat.asNumber().fmap((v) => Math.log2(v)));
|
||||
|
||||
/**
|
||||
* Assumes a numerical pattern. Returns a new pattern with all values set to
|
||||
* their mathematical ceiling. E.g. `3.2` replaced with `4`, and `-4.2`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue