Re: Machine epsilon: conclusion



Eric Sosman wrote:
jacob navia wrote:
Following the discussion about the machine epsilon, I have modified the
text as follows. I thank all people that contributed. It was interesting, and I surely learned stuff I did not consider before.
--------------------------------------------------------------
The machine epsilon
-------------------
The standard defines for each floating point representation (float, double, long double) the difference between 1 and the least value greater than 1 that is representable in the given floating point type. In IEEE754 representation this number has an exponent value of the bias, and a fraction of 1. [...]

It's been mentioned before, but what do you mean by "the bias?"
If you mean the offset added to the exponent's numerical value to
produce the encoded value, that's wrong. If you mean something
else, it would be as well to explain what you mean.


You are right again. Actually, the bias is 1023, and the value is
971.

#include <stdio.h>
#include <float.h>
int main(void)
{
double d = DBL_EPSILON;
int *p = (int *)&d;

printf("%a\n",DBL_EPSILON);
printf("0x%x 0x%x\n",p[0],p[1]);
}
0x1.000000p-52
0x0 0x3cb00000
3cb == 971
971-1023 --> -52
2 ^-52 --> 2.2204460492503130808472633361816e-16 -->DBL_EPSILON.

Similar calculations can be done for the other types. I will correct
this.

.



Relevant Pages

  • Re: Machine epsilon: conclusion
    ... jacob navia wrote: ... The machine epsilon ... The standard defines for each floating point representation the difference between 1 and the least value greater than 1 that is representable in the given floating point type. ...
    (comp.lang.c)
  • Re: How do you keep track of what all the numbers mean?
    ... that if you develop a floating point representation of a system, ... but I would suspect that scaling constants is a main part of it. ... There will be an assumed scaling between the floating point ... will depend upon the input signal power. ...
    (comp.dsp)
  • Re: Rounding of the double
    ... John von Neumann suggested that only fixed-point integers should be used because floating ... If you choose your representation as double, then you have to live with the consequences. ... you can never get precision in any computation on a computer than involves ... MVP Tips:http://www.flounder.com/mvp_tips.htm- Hide quoted text - ...
    (microsoft.public.vc.mfc)
  • Re: This calculation is just wrong / computer cant count!
    ... we have is the binary representation of the computer. ... your delusional system of mathematics, one based on a decimal arithmetic model, is ... "ignore" any aspect of floating point precision. ... "I do not wish to deal with the inherent inaccuracy of double precision floating point. ...
    (microsoft.public.vc.mfc)
  • Re: Gentler Decimal Floating-Point
    ... effectively change the radix of a decimal floating point ... under the heading "Logarithms all the time", ... logarithmic representation of numbers to be made workable for all the ... The middle digits are shifted only when the exponent, ...
    (comp.arch.arithmetic)