UNPKG

locutus

Version:

Locutus other languages' standard libraries to JavaScript for fun and educational purposes

12 lines (11 loc) 529 B
import { is_float as _isFloat } from "../var/is_float.js"; export function is_double(mixedVar) { // discuss at: https://locutus.io/php/is_double/ // parity verified: PHP 8.3 // original by: Paulo Freitas // 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_double(186.31) // returns 1: true return _isFloat(mixedVar); }