Help for this page

Select Code to Download


  1. or download this
    #include <math.h>
    #include <stdio.h>
    ...
        x = +NAN;      printf("trunc(%f) = %f\n", x, trunc(x));
        x = -NAN;      printf("trunc(%f) = %f\n", x, trunc(x));
    }
    
  2. or download this
    trunc(3.140000) = 3.000000
    trunc(-2.718000) = -2.000000
    ...
    trunc(-inf) = -inf
    trunc(nan) = nan
    trunc(nan) = nan