Epsilon Function; source wanted
Lazer Danzinger
lazer at mnetor.UUCP
Thu Sep 14 23:31:16 AEST 1989
If anyone has code for a function written in 'C' that returns the epsilon
of its (double) parameter, I would be really appreciative.
This function is commonly available under Basic as an instrinsic
function. Its definition is something like this:
double eps(x)
double x;
{
return Max(Max(x'-x, x-x"), epsilon);
}
where x' is the successor of x, and x" is the predecessor of x, and
espilon is the smallest number representable by the computer, eg.
MINDOUBLE (in values.h), or DBL_MIN (in float.h, under ANSI).
Thanks in advance.
--
-----------------------------------------------------------------------------
Lazer Danzinger | "Ben Zoma said, 'Who is wise? One who learns from
lazer at mnetor | every person...Who is courageous? One who conquers
| his [evil] inclination...Who is wealthy? One who is
| satisfied with his portion...Who is respected? One who
(416) 475-8980 | respects his fellow man...'" -- Avot 4:1
----------------------------------------------------------------------------
More information about the Comp.lang.c
mailing list