Determine if number is under or over .5

Hi,

It’s more of a math problem, but do you have any ideas what would be the best way to determine if a float’s decimal is under .5 or over .5? Whether it is 1000.3 or 0.6, I only need to know what the decimal is.

Thanks in advance.

float value = input % 1;

if(Mathf.Approximately(value,0.5f) return 0;

if(value< 0.5f) return -1;

return 1;