Skip to content

Instantly share code, notes, and snippets.

@tobie
Created November 9, 2016 20:58
Show Gist options
  • Save tobie/cf495a00600d904769c30fce05c0069f to your computer and use it in GitHub Desktop.
Save tobie/cf495a00600d904769c30fce05c0069f to your computer and use it in GitHub Desktop.
<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|.
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment