Skip to content

Instantly share code, notes, and snippets.

@Dramacydal
Created September 7, 2018 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dramacydal/231f9bae943c2a862db8484fb35a1e26 to your computer and use it in GitHub Desktop.
Save Dramacydal/231f9bae943c2a862db8484fb35a1e26 to your computer and use it in GitHub Desktop.
<?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