Created
September 7, 2018 14:08
-
-
Save Dramacydal/231f9bae943c2a862db8484fb35a1e26 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Checks that float value has fractional part | |
* | |
* @param float $value | |
* | |
* @return bool | |
*/ | |
function hasFractionalPart($value) | |
{ | |
return is_numeric($value) && abs(abs($value) - abs(floor($value))) > 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment