Re: Machine epsilon: conclusion



jacob navia said:

Richard Heathfield wrote:
jacob navia said:

Richard Heathfield wrote:
jacob navia said:

<snip>

For the different representations we have in the standard header
<float.h>:

#define FLT_EPSILON 1.19209290e-07F // float
#define DBL_EPSILON 2.2204460492503131e-16 // double
#define LDBL_EPSILON 1.084202172485504434007452e-19L //long double
// qfloat epsilon truncated so that it fits in this page...
#define QFLT_EPSILON 1.09003771904865842969737513593110651 ...
#E-106
You have the same bug as last time. No standard-conforming
implementation may define QFLT_EPSILON in the standard header
<float.h>, as I pointed out to you earlier this week.

I have told you thousand times that this can be disabled
by using -ansic.

You don't seem to understand my point, which is that you are
describing <float.h> as a *standard header*, and yet you *also*
describe it as containing QFLT_EPSILON. It can't *both* be a standard
header *and* contain QFLT_EPSILON at the same time. If it is a
standard header, it does not contain QFLT_EPSILON. If it contains
QFLT_EPSILON, it is not a standard header. Your claim that
QFLT_EPSILON is in a standard header is simply wrong, switch or no
switch.


The compiler you use has a file called
"math.h"

I use several implementations. Each of them is required to provide a
header named <math.h> - whether that header is implemented as a file is
a mere implementation detail.

There, I can read

# define M_E 2.7182818284590452354 /* e */
# define M_LOG2E 1.4426950408889634074 /* log_2 e */
# define M_LOG10E 0.43429448190325182765 /* log_10 e */
# define M_LN2 0.69314718055994530942 /* log_e 2 */
# define M_LN10 2.30258509299404568402 /* log_e 10 */
# define M_PI 3.14159265358979323846 /* pi */
# define M_PI_2 1.57079632679489661923 /* pi/2 */
# define M_PI_4 0.78539816339744830962 /* pi/4 */
# define M_1_PI 0.31830988618379067154 /* 1/pi */
# define M_2_PI 0.63661977236758134308 /* 2/pi */
# define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
# define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
# define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */

but that doesn't bother you since when you call that compiler
with the needed flags, those definitions do not appear.

If the implementation is not invoked with the needed flags, however,
then the above definitions in <math.h> render it a non-standard header.
It cannot both be a standard header *and* contain, say, M_PI. If it
contains M_PI, it is not a standard header. If it is a standard header,
it cannot contain M_PI.

When I do exactly the same you will argue without end.

Yes, because you're wrong.

The fact that my compiler is the only C compiler giving to the user
105 digits floating point precision is not important to you.

I have no idea whether that claim is true, and you're right that it
isn't the least bit important to me. I'm not talking about how much
floating point precision an implementation offers. I'm talking about
the incorrect claim that QFLT_EPSILON can be defined in a standard
header. It's simply wrong, Mr Navia.

Polemic, polemic without end, but you did not contribute anything
to this discussion.

I contributed a correction to your broken C tutorial. I even contributed
it twice, since you didn't seem to understand it the first time. Having
said that, you didn't understand it the second time either.

If you choose not to make the correction, that's up to you, but for as
long as it contains errors, your tutorial is still broken. Just how
broken it is depends on how many errors it contains. If your attitude
to error reports is that they do not represent a contribution, then
your tutorial is likely to contain many errors, and be very broken.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.



Relevant Pages

  • Re: Machine epsilon: conclusion
    ... jacob navia wrote: ... snip ... ... implementation may define QFLT_EPSILON in the standard header ... cbfalconer at maineline dot net ...
    (comp.lang.c)
  • Re: Machine epsilon: conclusion
    ... jacob navia wrote, On 30/06/07 23:42: ... mustn't appear in the standard header. ... It is guarded by ifdefs, as I have explained thousand times. ... Also some of those using your tutorial and compiler will probably then look at the header and be puzzled by the difference. ...
    (comp.lang.c)
  • Re: The machine epsilon
    ... jacob navia wrote, On 29/06/07 22:07: ... extended precision, much less use one. ... His point was that the information you were putting in your tutorial was incorrect, and your refutation of the correction was incorrect. ...
    (comp.lang.c)