[PATCH] D31561: cmath: Skip Libc for integral types in isinf, etc.

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 31 19:03:38 PDT 2017


dexonsmith created this revision.

For std::isinf, the standard requires effectively calling isinf as
double from Libc for integral types.  But integral types are never
infinite; we don't need to call Libc to return false.

      

Also short-circuit other functions where Libc won't have interesting
answers: signbit, fpclassify, isfinite, isnan, and isnormal.

      

I added correctness tests for integral types since we're no longer
deferring to Libc.


https://reviews.llvm.org/D31561

Files:
  libcxx/include/math.h
  libcxx/test/std/numerics/c.math/cmath.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31561.93734.patch
Type: text/x-patch
Size: 8759 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170401/37f86d90/attachment-0001.bin>


More information about the cfe-commits mailing list