[BACK]Return to s_roundf.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libm / src

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/lib/libm/src/s_roundf.c between version 1.1 and 1.2

version 1.1, 2004/07/10 13:49:10 version 1.2, 2007/08/21 20:10:27
Line 45  roundf(float x)
Line 45  roundf(float x)
                 return (x);                  return (x);
   
         if (x >= 0.0) {          if (x >= 0.0) {
                 t = ceilf(x);                  t = floorf(x);
                 if (t - x > 0.5)                  if (x - t >= 0.5)
                         t -= 1.0;                          t += 1.0;
                 return (t);                  return (t);
         } else {          } else {
                 t = ceilf(-x);                  x = -x;
                 if (t + x > 0.5)                  t = floorf(x);
                         t -= 1.0;                  if (x - t >= 0.5)
                           t += 1.0;
                 return (-t);                  return (-t);
         }          }
 }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

CVSweb <webmaster@jp.NetBSD.org>