Path: utzoo!mnetor!lazer From: lazer@mnetor.UUCP (Lazer Danzinger) Newsgroups: comp.lang.c Subject: Epsilon Function; source wanted Message-ID: <5085@mnetor.UUCP> Date: 14 Sep 89 13:31:16 GMT Organization: Motorola Computer X Lines: 29 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@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 ----------------------------------------------------------------------------