Re: [heycam/webidl] Refactor integer conversion in ES bindings. (#235)

tobie commented on this pull request.



> -        1.  Set |x| to min(max(|x|, 0), 2<sup>53</sup> − 1).
-        1.  Round |x| to the nearest integer, choosing the even integer if it lies halfway between two, and choosing +0 rather than −0.
-        1.  Return the IDL {{unsigned long long}} value that represents the same numeric value as |x|.
-    1.  If |x| is <emu-val>NaN</emu-val>, +0, −0, +∞, or −∞, then return the IDL {{unsigned long long}} value that represents 0.
-    1.  Set |x| to [=sign=](|x|) * [=floor=]([=abs=](|x|)).
-    1.  Set |x| to |x| [=modulo=] 2<sup>64</sup>.
-    1.  Return the IDL {{unsigned long long}} value that represents the same numeric value as |x|.
+        1.  Set |x| to [=min=]([=max=](|x|, |lowerBound|), |upperBound|).
+        1.  Round |x| to the nearest integer, choosing the even integer if it lies halfway between two,
+            and choosing +0 rather than −0.
+        1.  Return |x|.
+    1.  If |x| is <emu-val>NaN</emu-val>, +0, −0, +∞, or −∞,
+        then return 0.
+    1.  Set |x| to [=!=] <a abstract-op>IntegerPart</a>(|x|).
+    1.  Set |x| to |x| [=modulo=] 2<sup>|bitLength|</sup>.
+    1.  If |signedness| is "unsigned" and |x| ≥ 2<sup>|bitLength| − 1</sup>,

Yes, of course!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/235

Received on Friday, 11 November 2016 20:32:00 UTC