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.

Revisions

  1. tobie created this gist Nov 9, 2016.
    10 changes: 10 additions & 0 deletions algo.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    <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>