diff options
author | Marvin Borner | 2018-11-07 18:02:36 +0100 |
---|---|---|
committer | Marvin Borner | 2018-11-07 18:02:36 +0100 |
commit | 824a2d9f587ca017fc71b84d835e72f54f9c87c4 (patch) | |
tree | 765267ea4686f752aad1f69930cfee5680cc494a /node_modules/locutus/php/var/is_float.js | |
parent | fe75612e86b493a4e66c4e104e22658679cc014f (diff) |
Began rewrite
Diffstat (limited to 'node_modules/locutus/php/var/is_float.js')
-rw-r--r-- | node_modules/locutus/php/var/is_float.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/node_modules/locutus/php/var/is_float.js b/node_modules/locutus/php/var/is_float.js new file mode 100644 index 0000000..f8f8871 --- /dev/null +++ b/node_modules/locutus/php/var/is_float.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = function is_float(mixedVar) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/is_float/ + // original by: Paulo Freitas + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // improved by: WebDevHobo (http://webdevhobo.blogspot.com/) + // improved by: RafaĆ Kukawski (http://blog.kukawski.pl) + // note 1: 1.0 is simplified to 1 before it can be accessed by the function, this makes + // note 1: it different from the PHP implementation. We can't fix this unfortunately. + // example 1: is_float(186.31) + // returns 1: true + + return +mixedVar === mixedVar && (!isFinite(mixedVar) || !!(mixedVar % 1)); +}; +//# sourceMappingURL=is_float.js.map
\ No newline at end of file |