Android kernel libm pow(float,float) implementation?

The C standard is perfectly clear on this point (§F.9.4.4); there's no room for "ideas or thoughts": pow(−1, ±∞) returns 1 Annex F applies only if an implementation defines STDC_IEC_559 but there is no question that 1.0 is the right answer I suspect that this is a Java-ism that has leaked over into the NDK. (Java defines pow(-1,infinity) to be NaN ): If the absolute value of the first argument equals 1 and the second argument is infinite, then the result is NaN Edit: Since Matteo objects that this "makes no sense", I'll offer a few sentences of explanation for why the committee made this choice. Although lim_{n->inf} (-1)^n does not exist in the real numbers, we must remember that floating-point numbers are not real numbers and in fact, for all sufficiently large floating-point numbers y pow(-1,y) is 1 This is because all sufficiently large floating-point numbers are even integers.

From this perspective, it is quite reasonable to define pow(-1,infinity) to be 1 and this turns out to actually lead to more useful behavior in some floating-point computations There are a surprising number of extremely competent mathematicians (as well as very skilled programmers and compiler writers) involved with both the C and the IEEE-754 committees, and they do not make these decisions flippantly. Every standard has bugs, but this is not one of them.

The C standard is perfectly clear on this point (§F.9.4.4); there's no room for "ideas or thoughts": pow(−1, ±∞) returns 1. Annex F applies only if an implementation defines __STDC_IEC_559__, but there is no question that 1.0 is the right answer. I suspect that this is a Java-ism that has leaked over into the NDK.(Java defines pow(-1,infinity) to be NaN): If the absolute value of the first argument equals 1 and the second argument is infinite, then the result is NaN.

Edit: Since Matteo objects that this "makes no sense", I'll offer a few sentences of explanation for why the committee made this choice. Although lim_{n->inf} (-1)^n does not exist in the real numbers, we must remember that floating-point numbers are not real numbers, and in fact, for all sufficiently large floating-point numbers y, pow(-1,y) is +1. This is because all sufficiently large floating-point numbers are even integers.

From this perspective, it is quite reasonable to define pow(-1,infinity) to be +1, and this turns out to actually lead to more useful behavior in some floating-point computations. There are a surprising number of extremely competent mathematicians (as well as very skilled programmers and compiler writers) involved with both the C and the IEEE-754 committees, and they do not make these decisions flippantly. Every standard has bugs, but this is not one of them.

Mathematically speaking it makes no sense, since the limit for n->+inf of a^n does not exist for a– Stephen Canon Sep 14 at 0:40 +1 great explanation – R.. Sep 14 at 4:16.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions