Pow(-1, Infinity()) - what are your results?

For everything that's not in any way related to PureBasic. General chat etc...
DarkDragon
Addict
Addict
Posts: 2347
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Pow(-1, Infinity()) - what are your results?

Post by DarkDragon »

Hello,

I know this is a PureBasic forum, but I need to try this, as PureBasic uses C functions. Maybe you can help me understanding this situation through executing this C code on your machine:

Code: Select all

#include <stdio.h>
#include <math.h>

int main(int argc, char** argv)
{
  double zero = 0.0;
  double infinity = 1.0 / zero;
  
  printf("%f\n", pow(-1.0, infinity));
  printf("%f\n", pow(-2.0, infinity));
  printf("%f\n", pow(-1.0, -infinity));
  printf("%f\n", pow(-2.0, -infinity));
  printf("%f\n", pow(infinity, infinity));
  printf("%f\n", pow(-infinity, infinity));
  printf("%f\n", pow(infinity, -infinity));
  printf("%f\n", pow(-infinity, -infinity));
  
  return 0;
}
I already got some results, but no NaNs yet. It would be nice if you could tell me the operating system (also the version), your exact processor name, the processor type (amd64, x86, ...) and the compiler like here:
Intel Q6600 - Windows 7 (amd64, compiled with mingw-64):
1.000000
1.#INF00
1.000000
0.000000
1.#INF00
1.#INF00
0.000000
0.000000

AMD Phenom II X4 955 - Windows 7 (amd64, compiled with mingw-64):
1.000000
1.#INF00
1.000000
0.000000
1.#INF00
1.#INF00
0.000000
0.000000

Intel Core 2 Duo - Windows Vista (x86, compiled with mingw-32):
1.000000
1.#INF00
1.000000
0.000000
1.#INF00
1.#INF00
0.000000
0.000000

Intel Atom CPU 230 - Debian (x86, compiled with gcc):
1.000000
inf
1.000000
0.000000
inf
inf
0.000000
0.000000
Thanks for any responses.

[EDIT]
Here you can get the binaries: http://www.bradan.eu/files/test_binaries.zip.
Last edited by DarkDragon on Mon Sep 10, 2012 5:51 am, edited 1 time in total.
bye,
Daniel
User avatar
Shield
Addict
Addict
Posts: 1021
Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:

Re: Pow(-1, Infinity()) - what are your results?

Post by Shield »

Intel Core i7 M620 2.67GHz Windows 7 x64

Code: Select all

1.000000
1.#INF00
1.000000
0.000000
1.#INF00
1.#INF00
0.000000
0.000000
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Re: Pow(-1, Infinity()) - what are your results?

Post by jack »

Intel(R) Xeon X5650 gcc 4.2.1 on Mac OS X
1.000000
inf
1.000000
0.000000
inf
inf
0.000000
0.000000
-----------------
Intel(R) Xeon X5650 gcc 2.95 on Windows 7-32
1.000000
1.#INF00
-1.#IND00
0.000000
1.#INF00
1.#INF00
0.000000
0.000000
-----------------
Intel(R) Xeon X5650 VS 2008 on Windows 7-32
1.000000
1.#INF00
1.000000
0.000000
1.#INF00
1.#INF00
0.000000
0.000000
-----------------
Intel(R) Xeon X5650 VS 2010 on Windows 7-32
1.000000
1.#INF00
1.000000
0.000000
1.#INF00
1.#INF00
0.000000
0.000000
Last edited by jack on Mon Sep 10, 2012 6:34 am, edited 1 time in total.
DarkDragon
Addict
Addict
Posts: 2347
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: Pow(-1, Infinity()) - what are your results?

Post by DarkDragon »

Thanks for your answers. I've uploaded a few binaries which could be helpful: http://www.bradan.eu/files/test_binaries.zip.

@jack: it would be nice if you could write your exact windows version (xp, vista, 7, ...) to your results to be sure that the windows version doesn't matter.
bye,
Daniel
User avatar
KJ67
Enthusiast
Enthusiast
Posts: 218
Joined: Fri Jun 26, 2009 3:51 pm
Location: Westernmost tip of Norway

Re: Pow(-1, Infinity()) - what are your results?

Post by KJ67 »

It may have to do more on which compiler is used than hardware.
The odd on so far seems to be VS. Could be interesting to see these binaries on other hardware.
The best preparation for tomorrow is doing your best today.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3943
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Pow(-1, Infinity()) - what are your results?

Post by wilbert »

OS X (Core 2 Duo), XCode 4.4.1

Code: Select all

1.000000
inf
1.000000
0.000000
inf
inf
0.000000
0.000000
User avatar
Demivec
Addict
Addict
Posts: 4281
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: Pow(-1, Infinity()) - what are your results?

Post by Demivec »

Win XP Sp3 x86, AMD Athlon 64 Processor 3500+

Code: Select all

32Bit MinGW
1.000000
1.#INF00
1.000000
0.000000
1.#INF00
1.#INF00
0.000000
0.000000
---
32Bit VC2010
1.000000
1.#INF00
1.000000
0.000000
1.#INF00
1.#INF00
0.000000
0.000000
The first value of each test is different than what I get with PureBasic (posted elsewhere) even though they should be using the same functions.
DarkDragon
Addict
Addict
Posts: 2347
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: Pow(-1, Infinity()) - what are your results?

Post by DarkDragon »

Thanks for all your answers, but I must say I've expected some more NaNs since this :lol: . Let's go on for a while.
bye,
Daniel
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Pow(-1, Infinity()) - what are your results?

Post by c4s »

Win XP SP3 x86, AMD Sepron Mobile Processor 3000+
32Bit MinGW
1.000000
1.#INF00
1.000000
0.000000
1.#INF00
1.#INF00
0.000000
0.000000
---
32Bit VC2010
1.000000
1.#INF00
1.000000
0.000000
1.#INF00
1.#INF00
0.000000
0.000000
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
moogle
Enthusiast
Enthusiast
Posts: 372
Joined: Tue Feb 14, 2006 9:27 pm
Location: London, UK

Re: Pow(-1, Infinity()) - what are your results?

Post by moogle »

Windows 7 x64 Intel i7-2700K
32Bit MinGW
1.000000
1.#INF00
1.000000
0.000000
1.#INF00
1.#INF00
0.000000
0.000000
---
64Bit MinGW
1.000000
1.#INF00
1.000000
0.000000
1.#INF00
1.#INF00
0.000000
0.000000
---
32Bit VC2010
1.000000
1.#INF00
1.000000
0.000000
1.#INF00
1.#INF00
0.000000
0.000000
---
64Bit VC2010
1.000000
1.#INF00
1.000000
0.000000
1.#INF00
1.#INF00
0.000000
0.000000
Press any key to continue . . .
Image
Post Reply