Reimplement isinf/isnan/fpclassify.

Also move isinf and isnan into libc like everyone else.

Also move fpclassify to libc like the BSDs (but unlike glibc). We need
this to be able to upgrade our float/double/long double parsing to gdtoa.

Also add some missing aliases. We now have all of:

  isnan, __isnan, isnanf, __isnanf, isnanl, __isnanl,
  isinf, __isinf, isinff, __isinff, isinfl, __isinfl,
  __fpclassify, __fpclassifyd, __fpclassifyf, __fpclassifyl.

Bug: 13469877
Change-Id: I407ffbac06c765a6c5fffda8106c37d7db04f27d
diff --git a/tests/math_test.cpp b/tests/math_test.cpp
index 7734018..6758af1 100644
--- a/tests/math_test.cpp
+++ b/tests/math_test.cpp
@@ -239,6 +239,12 @@
   ASSERT_FALSE(finite(HUGE_VAL));
 }
 
+TEST(math, isinf_function) {
+  // The isinf macro deals with all three types; the isinf function is for doubles.
+  ASSERT_FALSE((isinf)(123.0));
+  ASSERT_TRUE((isinf)(HUGE_VAL));
+}
+
 TEST(math, __isinff) {
   ASSERT_FALSE(__isinff(123.0f));
   ASSERT_TRUE(__isinff(HUGE_VALF));
@@ -249,6 +255,12 @@
   ASSERT_TRUE(__isinfl(HUGE_VALL));
 }
 
+TEST(math, isnan_function) {
+  // The isnan macro deals with all three types; the isnan function is for doubles.
+  ASSERT_FALSE((isnan)(123.0));
+  ASSERT_TRUE((isnan)(nan("")));
+}
+
 TEST(math, __isnanf) {
   ASSERT_FALSE(__isnanf(123.0f));
   ASSERT_TRUE(__isnanf(nanf("")));