From 0ef62708ab6ebe41e3ea7c1dccf44c99b947b4e1 Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Fri, 4 Mar 2022 00:07:00 +0100 Subject: [PATCH] add Pattern.round --- strudel.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/strudel.mjs b/strudel.mjs index 137efa4e..4179215b 100644 --- a/strudel.mjs +++ b/strudel.mjs @@ -505,6 +505,10 @@ class Pattern { return this._asNumber()._opleft(other, a => b => a / b) } + round() { + return this._asNumber().fmap((v) => Math.round(v)); + } + union(other) { return this._opleft(other, a => b => Object.assign({}, a, b)) }