Repository: char0n/ramda-adjunct
Pull request #820 (2019-02-09 10:09:46)

feat: add floor
Ref #748




Patch:
diff --git a/package-lock.json b/package-lock.json
index a605d10dc1..2ef1e753f2 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -850,15 +850,15 @@
       }
     },
     "@commitlint/cli": {
-      "version": "7.3.1",
-      "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-7.3.1.tgz",
-      "integrity": "sha512-/ySTlSegey0mOpz4TxikTCV1JaAPOpouMiGg18RI10lpL5cgD4FgbZUg5zsSv+ZzsobEBRdpuGAjg8vvCIkiWg==",
+      "version": "7.5.1",
+      "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-7.5.1.tgz",
+      "integrity": "sha512-5LTc56dbuK+B83JPriUraORD/opZTqmJg43A0AgZLw01ougEvaE/bGqCEmMcEFapNohHPbdFLbuSRdXlUMWFMQ==",
       "dev": true,
       "requires": {
-        "@commitlint/format": "^7.3.1",
-        "@commitlint/lint": "^7.3.1",
-        "@commitlint/load": "^7.3.1",
-        "@commitlint/read": "^7.3.1",
+        "@commitlint/format": "^7.5.0",
+        "@commitlint/lint": "^7.5.1",
+        "@commitlint/load": "^7.5.0",
+        "@commitlint/read": "^7.5.0",
         "babel-polyfill": "6.26.0",
         "chalk": "2.3.1",
         "get-stdin": "5.0.1",
@@ -870,7 +870,7 @@
       "dependencies": {
         "chalk": {
           "version": "2.3.1",
-          "resolved": "http://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz",
           "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==",
           "dev": true,
           "requires": {
@@ -888,27 +888,27 @@
       "dev": true
     },
     "@commitlint/ensure": {
-      "version": "7.3.1",
-      "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-7.3.1.tgz",
-      "integrity": "sha512-JLn75OJaKo+dV/mjyOTlZJDM0bISdh+lpp6ABiXGk3c5ef4w7g5u5g/KC5/y0oAaCI7CLSe5ZebrhfOSO3oWaw==",
+      "version": "7.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-7.5.0.tgz",
+      "integrity": "sha512-zgHJFlHeO2/Wge6Yr/tlWLlZ7vJaCXnUaFsN5NaHb85PiWZTiuJmntJvh0l33pfiAVq41T2FT063vjUwFI4kSA==",
       "dev": true,
       "requires": {
         "lodash": "4.17.11"
       }
     },
     "@commitlint/execute-rule": {
-      "version": "7.3.1",
-      "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-7.3.1.tgz",
-      "integrity": "sha512-D6VfeRHj0mTSnQwILhYhL3afsNyGfbL/Xx85voaqklclmWQkZOAKtZuiw44QJXATajtsc5g84fwdj168RUcRUg==",
+      "version": "7.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-7.5.0.tgz",
+      "integrity": "sha512-K66aoly8mxSHmBA/Y8bKSPPcCAR4GpJEsvHaLDYOG7GsyChu8NgCD53L8GUqPW8lBCWwnmCiSL+RlOkNHJ0Gag==",
       "dev": true,
       "requires": {
         "babel-runtime": "6.26.0"
       }
     },
     "@commitlint/format": {
-      "version": "7.3.1",
-      "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-7.3.1.tgz",
-      "integrity": "sha512-DP0cAYAG4HJqZjJ+EHBD5XwW0LXmQ1TxV0qD0uScrQmxrPliBBTcE/2FbtuLqXvwr8PKJsnl7KtglAdKlhrsAQ==",
+      "version": "7.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-7.5.0.tgz",
+      "integrity": "sha512-DEeQXfTLUm9kARliCBfw3SlQRAYjK2aXeRAUMs1HPhLA2tjNFFGv6LOpFFNdiu/WV+o1ojcgIvBBjpHaVT+Tvw==",
       "dev": true,
       "requires": {
         "babel-runtime": "^6.23.0",
@@ -916,35 +916,35 @@
       }
     },
     "@commitlint/is-ignored": {
-      "version": "7.3.1",
-      "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-7.3.1.tgz",
-      "integrity": "sha512-Fz7Of30YKVg+wCJZK9qqojJiD45a4P32LLvXCHEb4/TLSwlKp/K/H6VeWK8kN4uUZHCx60PsKc6829l2Fm28Sw==",
+      "version": "7.5.1",
+      "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-7.5.1.tgz",
+      "integrity": "sha512-8JZCgy6bWSnjOT5cTTiyEAGp+Y4+5CUknhVbyiPxTRbjy6yF0aMKs1gMTfHrNHTKsasgmkCyPQd4C2eOPceuKA==",
       "dev": true,
       "requires": {
         "semver": "5.6.0"
       }
     },
     "@commitlint/lint": {
-      "version": "7.3.2",
-      "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-7.3.2.tgz",
-      "integrity": "sha512-NInm96JP89lMNR77R4zJRj/vaQWc4Ie5vR/5G5auFFiHuwyKmRWfXbGMA7zVYpAylPRgewGaELhuRzNTUW0Log==",
+      "version": "7.5.1",
+      "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-7.5.1.tgz",
+      "integrity": "sha512-y0clwEl+l1EcuFA1ckV0HnHJpH3VOBAmXGVBQicglvWGG1sXBl1iJUqBEzi2xExq36EINKsXLjs45272H9I1dQ==",
       "dev": true,
       "requires": {
-        "@commitlint/is-ignored": "^7.3.1",
-        "@commitlint/parse": "^7.3.1",
-        "@commitlint/rules": "^7.3.1",
+        "@commitlint/is-ignored": "^7.5.1",
+        "@commitlint/parse": "^7.5.0",
+        "@commitlint/rules": "^7.5.0",
         "babel-runtime": "^6.23.0",
         "lodash": "4.17.11"
       }
     },
     "@commitlint/load": {
-      "version": "7.3.1",
-      "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-7.3.1.tgz",
-      "integrity": "sha512-QBbEP3evr9F6PuYc2L6K6IX83IBG3McRff+ryyZkCAGQkXN/vFSugzmo+UrjuOEXnNEprBjrheieOmRKQCI4KQ==",
+      "version": "7.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-7.5.0.tgz",
+      "integrity": "sha512-fhBER/rzPsteM6zq5qqMiOi+A2bHKCE/0PKmOzYgaqTKcG9c1SsOle9phPemW85to8Gxd2YgUOVLsZkCMltLtA==",
       "dev": true,
       "requires": {
-        "@commitlint/execute-rule": "^7.3.1",
-        "@commitlint/resolve-extends": "^7.3.1",
+        "@commitlint/execute-rule": "^7.5.0",
+        "@commitlint/resolve-extends": "^7.5.0",
         "babel-runtime": "^6.23.0",
         "cosmiconfig": "^4.0.0",
         "lodash": "4.17.11",
@@ -952,15 +952,15 @@
       }
     },
     "@commitlint/message": {
-      "version": "7.3.1",
-      "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-7.3.1.tgz",
-      "integrity": "sha512-Jo/vMxlxqv0LswuJDqo9sWATH07lvgDaO8iJWsG6rVY8yajx1sfdHmPWthfnq43qRiBhsnSlv9m01DgJG3e47Q==",
+      "version": "7.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-7.5.0.tgz",
+      "integrity": "sha512-5YOhsqy/MgHH7vyDsmmzO6Jr3ygr1pXbCm9NR3XB51wjg55Kd6/6dVlkhS/FmDp99pfwTdHb0TyeDFEjP98waw==",
       "dev": true
     },
     "@commitlint/parse": {
-      "version": "7.3.1",
-      "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-7.3.1.tgz",
-      "integrity": "sha512-YqhRa6ktiNVUJ/3lOjCPjlZTPAhZ62X9GP68GUYwo1Ry0YsHdlW6s9yIB228d5OUijk1Jd2ZaeGLg3lqOOhQ8w==",
+      "version": "7.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-7.5.0.tgz",
+      "integrity": "sha512-hWASM8SBFTBtlFkKrEtD1qW6yTe2BsfoRiMKuYyRCTd+739TUF17og5vgQVuWttbGP0gXaciW44NygS2YjZmfA==",
       "dev": true,
       "requires": {
         "conventional-changelog-angular": "^1.3.3",
@@ -969,52 +969,64 @@
       }
     },
     "@commitlint/read": {
-      "version": "7.3.1",
-      "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-7.3.1.tgz",
-      "integrity": "sha512-w9D53Tb2KwwQG+q/Raf5d6wM5Z+XhpPNiLSg0w9CU3Tf2YCr0ewF5qWeSkry78pr/3UOGY1UVarH/zOYA7hh+w==",
+      "version": "7.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-7.5.0.tgz",
+      "integrity": "sha512-uqGFCKZGnBUCTkxoCCJp4MfWUkegXkyT0T0RVM9diyG6uNWPWlMH1509sjLFlyeJKG+cSyYGG/d6T103ScMb4Q==",
       "dev": true,
       "requires": {
-        "@commitlint/top-level": "^7.3.1",
+        "@commitlint/top-level": "^7.5.0",
         "@marionebl/sander": "^0.6.0",
         "babel-runtime": "^6.23.0",
         "git-raw-commits": "^1.3.0"
       }
     },
     "@commitlint/resolve-extends": {
-      "version": "7.3.1",
-      "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-7.3.1.tgz",
-      "integrity": "sha512-owlwYYTWsm7WY1XFkVJF4oAWSZ+rDRJtuSf6ANVSlCrYVTFBMDlhbYspAgjqexXqHQqLt9gVe9QSxpQAM4nhng==",
+      "version": "7.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-7.5.0.tgz",
+      "integrity": "sha512-FRIyPuqGvGa03OT4VgOHakizcw8YR5rdm77JsZff1rSnpxk6i+025I6qMeHqCIr5FaVIA0kR3FlC+MJFUs165A==",
       "dev": true,
       "requires": {
         "babel-runtime": "6.26.0",
+        "import-fresh": "^3.0.0",
         "lodash": "4.17.11",
-        "require-uncached": "^1.0.3",
         "resolve-from": "^4.0.0",
         "resolve-global": "^0.1.0"
+      },
+      "dependencies": {
+        "import-fresh": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.0.0.tgz",
+          "integrity": "sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ==",
+          "dev": true,
+          "requires": {
+            "parent-module": "^1.0.0",
+            "resolve-from": "^4.0.0"
+          }
+        }
       }
     },
     "@commitlint/rules": {
-      "version": "7.3.1",
-      "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-7.3.1.tgz",
-      "integrity": "sha512-tLabzCzD1bwjH11F7r7XbT6uOndiYFSTijvTK7EEaVFUrA0ejzmdIlVN7OYRCt0k63+8/KXv4AVXL0rts3MXtA==",
+      "version": "7.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-7.5.0.tgz",
+      "integrity": "sha512-+qXJB8teMgJSroSfFB46g3chskYp3oo51mbXnwhQir9AvO38wb6vRVdf7w4MMh8Xubjp9Xmj+ued1MhA1AnDEg==",
       "dev": true,
       "requires": {
-        "@commitlint/ensure": "^7.3.1",
-        "@commitlint/message": "^7.3.1",
-        "@commitlint/to-lines": "^7.3.1",
+        "@commitlint/ensure": "^7.5.0",
+        "@commitlint/message": "^7.5.0",
+        "@commitlint/to-lines": "^7.5.0",
         "babel-runtime": "^6.23.0"
       }
     },
     "@commitlint/to-lines": {
-      "version": "7.3.1",
-      "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-7.3.1.tgz",
-      "integrity": "sha512-whn12yY7PBGi0r5aBOihqCDgVZ9jQjO0IstMt43YT1r2puk6C1y57KnAAeU6aJ4xwaJIMyHl/Uv8aTGzbmHgZQ==",
+      "version": "7.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-7.5.0.tgz",
+      "integrity": "sha512-ZQ3LxPNuQ/J7q42hkiPWN5fUIjWae85H2HHoBB+/Rw1fo+oehvr4Xyt+Oa9Mx5WbBnev/wXnUFjXgoadv1RZ5A==",
       "dev": true
     },
     "@commitlint/top-level": {
-      "version": "7.3.1",
-      "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-7.3.1.tgz",
-      "integrity": "sha512-sJj6pQ8IegH4kyiM1vAmfJ+k+kjgBeMJ3UBsYsOfPSa7rp2N6ZEh0Cbkhxu9yLlWMFbBJBwiHT33QZJgTtnSfw==",
+      "version": "7.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-7.5.0.tgz",
+      "integrity": "sha512-oTu185GufTYHjTXPHu6k6HL7iuASOvDOtQizZWRSxj0VXuoki6e0HzvGZsRsycDTOn04Q9hVu+PhF83IUwRpeg==",
       "dev": true,
       "requires": {
         "find-up": "^2.1.0"
@@ -2207,27 +2219,12 @@
         }
       }
     },
-    "caller-path": {
-      "version": "0.1.0",
-      "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz",
-      "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=",
-      "dev": true,
-      "requires": {
-        "callsites": "^0.2.0"
-      }
-    },
     "callsite": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz",
       "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=",
       "dev": true
     },
-    "callsites": {
-      "version": "0.2.0",
-      "resolved": "http://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz",
-      "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=",
-      "dev": true
-    },
     "camelcase": {
       "version": "4.1.0",
       "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
@@ -2639,7 +2636,7 @@
     },
     "conventional-changelog-angular": {
       "version": "1.6.6",
-      "resolved": "http://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-1.6.6.tgz",
+      "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-1.6.6.tgz",
       "integrity": "sha512-suQnFSqCxRwyBxY68pYTsFkG0taIdinHLNEAX5ivtw8bCRnIgnpvcHmlR/yjUyZIrNPYAoXlY1WiEKWgSE4BNg==",
       "dev": true,
       "requires": {
@@ -2884,7 +2881,7 @@
     },
     "conventional-commits-parser": {
       "version": "2.1.7",
-      "resolved": "http://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-2.1.7.tgz",
+      "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-2.1.7.tgz",
       "integrity": "sha512-BoMaddIEJ6B4QVMSDu9IkVImlGOSGA1I2BQyOZHeLQ6qVOJLcLKn97+fL6dGbzWEiqDzfH4OkcveULmeq2MHFQ==",
       "dev": true,
       "requires": {
@@ -2916,7 +2913,7 @@
         },
         "minimist": {
           "version": "1.2.0",
-          "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+          "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
           "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
           "dev": true
         }
@@ -5319,7 +5316,7 @@
     },
     "git-raw-commits": {
       "version": "1.3.6",
-      "resolved": "http://registry.npmjs.org/git-raw-commits/-/git-raw-commits-1.3.6.tgz",
+      "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-1.3.6.tgz",
       "integrity": "sha512-svsK26tQ8vEKnMshTDatSIQSMDdz8CxIIqKsvPqbtV23Etmw6VNaFAitu8zwZ0VrOne7FztwPyRLxK7/DIUTQg==",
       "dev": true,
       "requires": {
@@ -5349,7 +5346,7 @@
         },
         "minimist": {
           "version": "1.2.0",
-          "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+          "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
           "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
           "dev": true
         }
@@ -9510,24 +9507,6 @@
       "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=",
       "dev": true
     },
-    "require-uncached": {
-      "version": "1.0.3",
-      "resolved": "http://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz",
-      "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=",
-      "dev": true,
-      "requires": {
-        "caller-path": "^0.1.0",
-        "resolve-from": "^1.0.0"
-      },
-      "dependencies": {
-        "resolve-from": {
-          "version": "1.0.1",
-          "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz",
-          "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=",
-          "dev": true
-        }
-      }
-    },
     "requires-port": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
diff --git a/package.json b/package.json
index 822f85e4a8..f89970ec82 100644
--- a/package.json
+++ b/package.json
@@ -139,7 +139,7 @@
     "@babel/polyfill": "7.2.5",
     "@babel/preset-env": "7.3.1",
     "@babel/register": "=7.0.0",
-    "@commitlint/cli": "7.3.1",
+    "@commitlint/cli": "7.5.1",
     "@commitlint/config-conventional": "7.3.1",
     "babel-loader": "8.0.5",
     "babel-plugin-annotate-pure-calls": "0.4.0",
diff --git a/src/floor.js b/src/floor.js
new file mode 100644
index 0000000000..f8f96f22c2
--- /dev/null
+++ b/src/floor.js
@@ -0,0 +1,28 @@
+import { bind } from 'ramda';
+import curry1 from 'ramda/src/internal/_curry1';
+
+/**
+ * Returns the largest integer less than or equal to a given number.
+ *
+ * Note: floor(null) returns integer 0 and do not give a NaN error.
+ *
+ * @func floor
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.15.0|v2.15.0}
+ * @category Math
+ * @sig Number -> Number
+ * @param {number} number The number to floor
+ * @return {number} A number representing the largest integer less than or equal to the specified number
+ * @example
+ *
+ * RA.floor(45.95); //=> 45
+ * RA.floor(45.05); //=> 45
+ * RA.floor(4); //=> 4
+ * RA.floor(-45.05); //=> -46
+ * RA.floor(-45.95); //=> -46
+ * RA.floor(null); //=> 0
+ */
+
+const floor = curry1(bind(Math.floor, Math));
+
+export default floor;
diff --git a/src/index.d.ts b/src/index.d.ts
index ab62737677..0535949210 100644
--- a/src/index.d.ts
+++ b/src/index.d.ts
@@ -1067,6 +1067,13 @@ declare namespace RamdaAdjunct {
          */
         ceil(val: number): number;
 
+        /**
+         * Returns the largest integer less than or equal to a given number.
+         *
+         * Note: floor(null) returns integer 0 and do not give a NaN error.
+         */
+        floor(val: number): number
+
         /**
          * Identity type.
          */
diff --git a/src/index.js b/src/index.js
index 0ce31dfa34..08adc13303 100644
--- a/src/index.js
+++ b/src/index.js
@@ -165,5 +165,6 @@ export { default as dropArgs } from './dropArgs';
 // Math
 export { default as round } from './round';
 export { default as ceil } from './ceil';
+export { default as floor } from './floor';
 // Types
 export { default as Identity } from './fantasy-land/Identity';


Test patch:
diff --git a/test/ceil.js b/test/ceil.js
index 83b6b91c9a..3929ddfa5c 100644
--- a/test/ceil.js
+++ b/test/ceil.js
@@ -45,7 +45,7 @@ describe('ceil', function() {
     specify('should throw TypeError', function() {
       let shouldThrow;
       try {
-        Math.round(Symbol(''));
+        Math.ceil(Symbol(''));
         shouldThrow = false;
       } catch (e) {
         shouldThrow = true;
diff --git a/test/floor.js b/test/floor.js
new file mode 100644
index 0000000000..8ded049d45
--- /dev/null
+++ b/test/floor.js
@@ -0,0 +1,81 @@
+import * as R from 'ramda';
+import { assert } from 'chai';
+
+import * as RA from '../src';
+import eq from './shared/eq';
+import Symbol from './shared/Symbol';
+
+describe('floor', function() {
+  it('should floor float to nearest integer', function() {
+    eq(RA.floor(0.9), 0);
+    eq(RA.floor(5.95), 5);
+    eq(RA.floor(5.5), 5);
+    eq(RA.floor(5.05), 5);
+    eq(RA.floor(-5.05), -6);
+    eq(RA.floor(-5.5), -6);
+    eq(RA.floor(-5.95), -6);
+  });
+
+  context('given integer number', function() {
+    specify('should return original integer number', function() {
+      eq(RA.floor(0), 0);
+      eq(RA.floor(1), 1);
+      eq(RA.floor(-1), -1);
+    });
+  });
+
+  context('given value that is not a number', function() {
+    specify('should return NaN', function() {
+      eq(RA.floor(undefined), NaN);
+      eq(RA.floor(NaN), NaN);
+      eq(RA.floor({}), NaN);
+      eq(RA.floor(/a/), NaN);
+      eq(RA.floor('test'), NaN);
+      eq(RA.floor(new Error()), NaN);
+    });
+  });
+
+  context('given null', function() {
+    specify('should return 0', function() {
+      eq(RA.floor(null), 0);
+    });
+  });
+
+  context('given Symbol value', function() {
+    specify('should throw TypeError', function() {
+      let shouldThrow;
+      try {
+        Math.floor(Symbol(''));
+        shouldThrow = false;
+      } catch (e) {
+        shouldThrow = true;
+      }
+
+      if (shouldThrow) {
+        assert.throw(() => RA.floor(Symbol('')));
+      }
+    });
+  });
+
+  context('given valid date object', function() {
+    specify(
+      'should return the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC',
+      function() {
+        eq(RA.floor(new Date(2)), 2);
+      }
+    );
+  });
+
+  context('given Infinity value', function() {
+    specify('should return untouched Infinity value', function() {
+      eq(RA.floor(Infinity), Infinity);
+      eq(RA.floor(-Infinity), -Infinity);
+    });
+  });
+
+  it('should support placeholder to specify "gaps"', function() {
+    const floor = RA.floor(R.__);
+
+    eq(floor(0.9), 0);
+  });
+});