nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

round() problems with NaN

Open nealef opened this issue 3 years ago • 0 comments

round() and roundf() (and presumably roundl()) don't return the correct value for NaN. Instead it is returning 0. Do these functions require a check such as:

  if (isinf(x) || isnan(x))
    return (x);

Prior to performing the rounding operation? (The check for infinity just saves having to go through the rest of the process.)

nealef avatar Aug 03 '22 06:08 nealef