From 5a7b8bd2d6f6577df4b4dcec8ef10a73f2179960 Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Sat, 15 Aug 2015 12:28:57 +0200 Subject: [PATCH] Add a Ceiling to the monadic math-block-thing (Does that block have a name?) This is good for two reasons: * it just makes sense to have floor and ceiling together * It's a minor thing for scratch 2 parity. * it doesn't clutter anything. :grin: --- blocks.js | 1 + threads.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/blocks.js b/blocks.js index 8e16529c..717f2578 100644 --- a/blocks.js +++ b/blocks.js @@ -1149,6 +1149,7 @@ SyntaxElementMorph.prototype.labelPart = function (spec) { false, { abs : ['abs'], + ceiling : ['ceiling'], floor : ['floor'], sqrt : ['sqrt'], sin : ['sin'], diff --git a/threads.js b/threads.js index ee0c8b3b..e0d5fbb9 100644 --- a/threads.js +++ b/threads.js @@ -2115,6 +2115,9 @@ Process.prototype.reportMonadic = function (fname, n) { case 'abs': result = Math.abs(x); break; + case 'ceiling': + result = Math.ceil(x); + break; case 'floor': result = Math.floor(x); break;