$value) { if (substr_count($n, (string) $place) != $value) { return false; } } return true; } /** * Is square number? * * @param int $n Number to test * * @return bool * * @since 1.0.0 */ public static function isSquare(int $n) : bool { return abs(((int) sqrt($n)) * ((int) sqrt($n)) - $n) < 0.001; } /** * Count trailling zeros * * @param int $n Number to test * * @return int * * @since 1.0.0 */ public static function countTrailingZeros(int $n) : int { $count = 0; while ($n !== 0) { if ($n & 1 == 1) { break; } else { $count++; $n = $n >> 1; } } return $count; } }