Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Jonathan Liu <net147@gm...>  20120412 12:25:18
Attachments:
powtest.cpp

Hi, I am getting some inconsistencies for the C pow() function between MinGWw64 and Visual C++: compare(INFINITY, pow(INFINITY, 3.1)); Compared values are not the same (test.cpp:145) Expected (INFINITY): 1.#INF00 Actual (pow(INFINITY, 3.1)): 1.#IND00 compare(+INFINITY, 1.0/pow(INFINITY, 3.1)); Compared values are not the same (test.cpp:145) Expected (INFINITY): 1.#INF00 Actual (pow(INFINITY, 3.1)): 1.#IND00 compare(INFINITY, pow(0.0, 3.1)); Compared values are not the same (test.cpp:151) Expected (+INFINITY): 1.#INF00 Actual (1.0/pow(INFINITY, 3.1)): 1.#IND00 compare(INFINITY, pow(0.0, 3.1)); Compared values are not the same (test.cpp:169) Expected (INFINITY): 1.#INF00 Actual (pow(0.0, 3.1)): 1.#IND00 compare(+INFINITY, pow(0.0, 0.5)); Compared values are not the same (test.cpp:186) Expected (+INFINITY): 1.#INF00 Actual (pow(0.0, 0.5)): 1.#IND00 compare(+INFINITY, pow(0.0, 0.6)); Compared values are not the same (test.cpp:187) Expected (+INFINITY): 1.#INF00 Actual (pow(0.0, 0.6)): 1.#IND00 I have attached program for testing with workarounds (enabled by defining WORKAROUNDS to 1) for MinGW and MinGWw64. Visual C++ 2010 is the reference here. Regards, Jonathan 
From: Ruben Van Boxem <vanboxem.ruben@gm...>  20120412 13:46:32
Attachments:
Message as HTML

2012/4/12 Jonathan Liu <net147@...> > Hi, > > I am getting some inconsistencies for the C pow() function between > MinGWw64 and Visual C++: > > compare(INFINITY, pow(INFINITY, 3.1)); > Compared values are not the same (test.cpp:145) > Expected (INFINITY): 1.#INF00 > Actual (pow(INFINITY, 3.1)): 1.#IND00 > > compare(+INFINITY, 1.0/pow(INFINITY, 3.1)); > Compared values are not the same (test.cpp:145) > Expected (INFINITY): 1.#INF00 > Actual (pow(INFINITY, 3.1)): 1.#IND00 > > compare(INFINITY, pow(0.0, 3.1)); > Compared values are not the same (test.cpp:151) > Expected (+INFINITY): 1.#INF00 > Actual (1.0/pow(INFINITY, 3.1)): 1.#IND00 > > compare(INFINITY, pow(0.0, 3.1)); > Compared values are not the same (test.cpp:169) > Expected (INFINITY): 1.#INF00 > Actual (pow(0.0, 3.1)): 1.#IND00 > > compare(+INFINITY, pow(0.0, 0.5)); > Compared values are not the same (test.cpp:186) > Expected (+INFINITY): 1.#INF00 > Actual (pow(0.0, 0.5)): 1.#IND00 > > compare(+INFINITY, pow(0.0, 0.6)); > Compared values are not the same (test.cpp:187) > Expected (+INFINITY): 1.#INF00 > Actual (pow(0.0, 0.6)): 1.#IND00 > > I have attached program for testing with workarounds (enabled by defining > WORKAROUNDS to 1) for MinGW and MinGWw64. Visual C++ 2010 is the reference > here. > I don't know what the standard says about these cases, but raising a negative number to an integer power is indeterminate (because there is more than one solution to the equation). The rational or real powers lead to complex numbers, which you did not use the functions for. If you're calculating these quantities, you need complex mathematics. Ruben Regards, > Jonathan > > >  > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in UltraFine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundaryd2dvs2 > _______________________________________________ > Mingww64public mailing list > Mingww64public@... > https://lists.sourceforge.net/lists/listinfo/mingww64public > > 
From: Jonathan Liu <net147@gm...>  20120413 08:56:49

Visual C++ 2010 and GCC on Linux give the same expected output for these tests and pass. I just think it would be good if MinGWw64 gave results that were more consistent with Visual C++ 2010 and GCC on Linux. The tests are based on what Google V8 expects to be the correct output  the difference in behavior is causing Google V8 mjsunit/mathpow unit tests to fail. Regards, Jonathan On 12/04/2012 11:46 PM, Ruben Van Boxem wrote: > I don't know what the standard says about these cases, but raising a > negative number to an integer power is indeterminate (because there is > more than one solution to the equation). The rational or real powers > lead to complex numbers, which you did not use the functions for. If > you're calculating these quantities, you need complex mathematics. > > Ruben 
From: NightStrike <nightstrike@gm...>  20120413 11:54:43

On Fri, Apr 13, 2012 at 4:39 AM, Jonathan Liu <net147@...> wrote: > Visual C++ 2010 and GCC on Linux give the same expected output for these > tests and pass. I just think it would be good if MinGWw64 gave results > that were more consistent with Visual C++ 2010 and GCC on Linux. The > tests are based on what Google V8 expects to be the correct output  the > difference in behavior is causing Google V8 mjsunit/mathpow unit tests > to fail. Are you using the new math library that Kai wrote? 
From: Jonathan Liu <net147@gm...>  20120414 07:35:12

On 13/04/2012 9:54 PM, NightStrike wrote: > On Fri, Apr 13, 2012 at 4:39 AM, Jonathan Liu<net147@...> wrote: >> Visual C++ 2010 and GCC on Linux give the same expected output for these >> tests and pass. I just think it would be good if MinGWw64 gave results >> that were more consistent with Visual C++ 2010 and GCC on Linux. The >> tests are based on what Google V8 expects to be the correct output  the >> difference in behavior is causing Google V8 mjsunit/mathpow unit tests >> to fail. > > Are you using the new math library that Kai wrote? I did testing using mingww64bin_i686cygwin1.7.111_20120412.tar.bz2 automated build from MinGWw64 site. From what I gather, it's using math functions that Kai wrote. Regards, Jonathan 
From: Jonathan Liu <net147@gm...>  20120414 07:45:31
Attachments:
powtest.cpp

Attached is an updated test program. It will now show all failures at once instead of terminating after the first test failure. Regards, Jonathan 
From: Kai Tietz <ktietz70@go...>  20120414 15:41:35

Hmm, well our implementation interpretes the ISO C99 definition "pow (x, y) signals the invalid operation exception for finite x < 0 and finite noninteger y. Therefore has as result Nan. Having here result +Inf looks wrong to me. Cheers, Kai 
From: Jonathan Liu <net147@gm...>  20120416 10:04:07

On 15/04/2012 1:41 AM, Kai Tietz wrote: > Hmm, well our implementation interpretes the ISO C99 definition > > "pow (x, y) signals the invalid operation exception for finite x< 0 > and finite noninteger y. Therefore has as result Nan. Compared values are not the same (powtest.cpp:149) Expected (INFINITY): 1.#INF00 Actual (pow(INFINITY, 3.1)): 1.#IND00 Compared values are not the same (powtest.cpp:155) Expected (+INFINITY): 1.#INF00 Actual (1.0/pow(INFINITY, 3.1)): 1.#IND00 Compared values are not the same (powtest.cpp:173) Expected (INFINITY): 1.#INF00 Actual (pow(0.0, 3.1)): 1.#IND00 Compared values are not the same (powtest.cpp:190) Expected (+INFINITY): 1.#INF00 Actual (pow(0.0, 0.5)): 1.#IND00 Compared values are not the same (powtest.cpp:191) Expected (+INFINITY): 1.#INF00 Actual (pow(0.0, 0.6)): 1.#IND00 > > Having here result +Inf looks wrong to me. Where is the finite x < 0 here? INFINITY is not finite and 0.0 is not < 0. Regards, Jonathan 
Sign up for the SourceForge newsletter:
No, thanks