Changeset 3b814c3a in mainline for uspace/lib/math/generic/trunc.c


Ignore:
Timestamp:
2018-08-30T19:12:03Z (7 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Children:
bbdca54
Parents:
ace1bca4
Message:

Add nearbyint() and PCUT-based tests for present rounding functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/math/generic/trunc.c

    race1bca4 r3b814c3a  
    5555float truncf(float val)
    5656{
    57         /* If the input is a nan, return a canonical nan. */
    58         if (isnan(val))
    59                 return __builtin_nanf("");
    60 
    6157        const int exp_bias = FLT_MAX_EXP - 1;
    6258        const int mant_bits = FLT_MANT_DIG - 1;
     
    9995double trunc(double val)
    10096{
    101         /* If the input is a nan, return a canonical nan. */
    102         if (isnan(val))
    103                 return __builtin_nan("");
    104 
    10597        const int exp_bias = DBL_MAX_EXP - 1;
    10698        const int mant_bits = DBL_MANT_DIG - 1;
Note: See TracChangeset for help on using the changeset viewer.