Skip to content

Instantly share code, notes, and snippets.



Created Nov 9, 2016
What would you like to do?
<div algorithm>
To compute the <dfn lt="IntegerPart">integer part</dfn> of an ECMAScript number |n|,
the following steps must be taken:
1. Let |r| be [=floor=]([=abs=](|n|))
1. If |n| &lt; 0,
then return -1 * |r|.
1. Otherwise return |r|.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment