c++ - machine precision and max and min value of a double-precision type -


(1) I have met in many cases where a non-negative variable to guarantee non-negative value in Epislon has been added. So I wonder why not to add the minimum value of the appellan instead of the data type? What are the differences that these two can solve? Apart from this I have seen that the inverse of the maximum value of a double precision type is greater than its minimum value, and its minimum value is inverted inf, its maximum value than its maximum value is its max. And is it useful to calculate the interactive analysis of minimum values?

(3) For the very least positive number of double types, to calculate its reciprocal, how small is it when it does not start mutually? Is it better to force upper bounds on reciprocity? How much bound?

Thanks and relation

You have to understand how floating point numbers are in CPU In the data type displayed, 1 bit is reserved for sign, i.e. this is a positive or negative number, (yes you can have positive and negative 0 in the floating point number), so many bits reserved for importance (Or Mantissa, these floating point numbers are important points) and Finally reserve several bit exponent. The value of floating point number is now:

-1 ^ sign * importance and * 2 ^ exponent

  1. This means that the small number is a very low value That is, the smallest aspects mean the minimum exponent. The spherical error is too big and it depends on the magnitude of the number, i.e. the smallest number with a given exponent. The difference between Epicelon 1.0 and the next major value is the difference. This is the reason that Epsilon is used in code which is strong for round errors, and in fact you should scale the Epsilon with the magnitude of the numbers working with you. If you correct it, the smallest representable value actually There is no significant use in the.

  2. The problem you are seeing between the normalized and denormalized minimum is that the way the importance is used and the reason is that a greater negative exponent It is possible to say, that except for the bit pattern and the last bit of importance all are zero, which is one, the exponent is effectively less than the number of bits in importance. You can not do this to maximize, even if you all set importance, effective exponents will still be given only to the exponent that has been given. That is, think about the difference between 0.000001e-10 and 9.999 999e + 10, the first is second big, the first is actually 1e-16, while the second is approximately 1e + 11.

  3. This is definitely dependent on the accuracy of the floating point number. In the case of double precision, the difference between the maximum and the next small value is already larger (on the lines of 10 ^ 292), so your rounding errors will be very large. If the price is too small then you will only convert in turn, as you already saw. In fact, there is no strict answer, it depends on the accuracy of the numbers you need. Given that the spherical error is almost epicylon * magnitude, (1 / epsolon) is already a rotating error around 1.0 already, if you need the number to be exact for 1e-3, then also the epiclon To be very big to split. / P>

Look for these Wikipedia pages and for some background information.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -