This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran] I/O of large integer and real kinds


+#if defined (HAVE_GFC_REAL_10) || defined (HAVE_GFC_REAL_16)
+# if HAVE_LOG10L || HAVE_LOG10L_IN_LIBSUNMATH
+      abslog = fabs(log10l (value));

fabsl

No need for that. fabsl is not available on some platforms, and the case where the exponent of a value does not fit into a double... well, let's say it won't occur often enough to justify the extra trouble.


Perhaps it is better to write the case explicitly?
  abslog = fabs ((double) log10l (value));

+  sprintf (buffer, "%+-#31.*" GFC_REAL_LARGEST_FORMAT "e",
+           ndigits - 1, value);

In the case of long double, do we need to "Le" instead of "e"?

Yes.


Shouldn't this be someting like

#if (HAVE_GFC_REAL_10 || HAVE_GFC_REAL_16)
# if HAVE_FINITEL
    res = finitel (n);
# else
    res = gfc_finitel (n);  /* a builtin or we supply in c99_functions.c */
# endif
#else

Yes, provided someone can write gfc_finitel in short time. Other than that, using isfinite (and the implicit cast to double if need be) provides a graceful degradation, I think.



-  uint64_t n = 0;
+//FXC  uint32_t ns =0;

Sorry for these. Will be removed in next version of the patch.


FX


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]