Skip to content
  • Philip Withnall's avatar
    gdatetime: Use isnan() instead of !isfinite() · 50a3d0bf
    Philip Withnall authored
    
    
    Both are provided by libm, but `isnan()` is provided as a macro, whereas
    `isfinite()` is an actual function, and hence libm has to be available
    at runtime. That didn’t trivially work on FreeBSD, resulting in this
    refactor.
    
    `isfinite(x)` is equivalent to `!isnan(x) && !isinfinite(x)`. The case
    of `x` being (negative or positive) infinity is already handled by the
    range checks on the next line, so it’s safe to switch to `isnan()` here.
    
    Signed-off-by: default avatarPhilip Withnall <pwithnall@endlessos.org>
    50a3d0bf