Recent

Author Topic: Where could I find documentation on nan  (Read 8620 times)

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Where could I find documentation on nan
« Reply #15 on: February 05, 2021, 02:19:50 pm »
Hi!

No, 0^0 result in 1.

Look at the implementation of intpower:
Code: Pascal  [Select][+][-]
  1. function intpower(base : float;const exponent : Integer) : float;
  2.   var
  3.      i : longint;
  4.   begin
  5.      if (base = 0.0) and (exponent = 0) then
  6.        result:=1
  7.      else
  8.       ....


Winni

ArtLogi

  • Full Member
  • ***
  • Posts: 184
Re: Where could I find documentation on nan
« Reply #16 on: February 05, 2021, 02:41:28 pm »
Hi!

No, 0^0 result in 1.

Look at the implementation of intpower:
Code: Pascal  [Select][+][-]
  1. function intpower(base : float;const exponent : Integer) : float;
  2.   var
  3.      i : longint;
  4.   begin
  5.      if (base = 0.0) and (exponent = 0) then
  6.        result:=1
  7.      else
  8.       ....


Winni
Which is not correct if both are considered as whole numbers. By judging the base = 0.0 implementer have been thinking of zero dot zero as something almost zero, but only almost. In other words 0 + infinitely small subnormal value.

Maybe there is reason float definition was build as it was build, with all those NaNs, subnormals, infinities etc.  ::)
« Last Edit: February 05, 2021, 02:51:37 pm by ArtLogi »
While Record is a drawer and method is a clerk, when both are combined to same space it forms an concept of office, which is alias for a great suffering.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6692
Re: Where could I find documentation on nan
« Reply #17 on: February 05, 2021, 03:00:08 pm »
Which is not correct if both are considered as whole numbers. By judging the base = 0.0 implementer have been thinking of zero dot zero as something almost zero, but only almost. In other words 0 + infinitely small subnormal value.

Which is not correct since if the exponent- which is an integer- is zero the result is 1 by definition, so a continued attempt at evaluation might result in an error.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Where could I find documentation on nan
« Reply #18 on: February 05, 2021, 03:02:00 pm »
Hi!

That is ambigouos:

a) 0^0 = 0 -- true!
b) 0^0 = 1 -- true

a) 0^AnyInteger = 0 - correct
b) anyInteger ^0 = 1 - correct

There are books about this borderline case!

Try to avoid it!

Winni

ArtLogi

  • Full Member
  • ***
  • Posts: 184
Re: Where could I find documentation on nan
« Reply #19 on: February 05, 2021, 03:47:16 pm »
These are funny. Can not say more, since this will again remind me why in no world would I spend my life as mathematician. My mind disagrees, but I'm sure there is tens of thousands pages of proves in all directions.

Have anyone translated the Dr. Kahans Paranoia from 1988 (or earlier) test software to FPC?
« Last Edit: February 05, 2021, 03:50:33 pm by ArtLogi »
While Record is a drawer and method is a clerk, when both are combined to same space it forms an concept of office, which is alias for a great suffering.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6692
Re: Where could I find documentation on nan
« Reply #20 on: February 05, 2021, 03:57:27 pm »
Any universe in which unity has irrational roots is weird by definition :-)

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

ArtLogi

  • Full Member
  • ***
  • Posts: 184
Re: Where could I find documentation on nan
« Reply #21 on: February 05, 2021, 04:07:09 pm »
Any universe in which unity has irrational roots is weird by definition :-)

MarkMLl
Or maybe the system that defines it have flaws. But again I have not devoted my life to proof it to direction or another, not that a single life would be enough.  :D  Where on earth I have come across the Paranoia pascal source....
While Record is a drawer and method is a clerk, when both are combined to same space it forms an concept of office, which is alias for a great suffering.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Where could I find documentation on nan
« Reply #22 on: February 05, 2021, 05:19:04 pm »
Hi!

You can go further with this madness:

Code: Text  [Select][+][-]
  1. 0^0 = 0^-0
  2.  
  3. 0^-0 = 1 / 0^0
  4.  
  5.  
Outsch!

Unless you don't behave like the C boys, who switch the Floating  Point errors off.

Winni

ArtLogi

  • Full Member
  • ***
  • Posts: 184
Re: Where could I find documentation on nan
« Reply #23 on: February 05, 2021, 07:14:29 pm »
Hi!

You can go further with this madness:

Code: Text  [Select][+][-]
  1. [b]A)[/b] 0^0 = 0^-0
  2.  
  3. [b]B)[/b] 0^-0 = 1 / 0^0
  4.  
  5.  
Outsch!

Unless you don't behave like the C boys, who switch the Floating  Point errors off.

Winni

That I can "understand" that it could be calculated with concept of infinitesimal (which I probably misuse), by that as starting point 0^-0 (which leads to me suspect that it is chicken-and-egg problem. The solution is usually to boil the eggs and fry the chicken) which then is by (probably misused rules) would be 0/0 and can be easily rounded to one, at least if we throw mathematics with empty beer bottle. Just amusing mind game.
If defined that o = 1/∞, if we replace zeros from above madness with this then it turns in to a form.

Lets rewrite

A = 0^0 = o/o
B) o/o = 1 // o / o

Then drop in the non-zero zero and assume that all infinities do have same revision number (so ∞=∞ and argument of non-division do not apply, think we overwrite some of the parent methods here)

A) 0.0^0 = 1/∞ / 1/∞   
B) 1/∞//1/∞ = 1 /// 1/∞ // 1/∞

Lets rearrange the B as
B) 1/∞ * ∞/1 =  1 // 1/∞ * ∞/1

Then by some formulation we get
B) 1/1 * 1/1 = 1 // 1/1 * 1/1
B) 1=1 which is true

When A is taken for another round of beating.
A) 0.0^0 = 1

Which alternatively might be place for another bottle of beer.
(1/∞)√(1/∞) = 1
(o)√(o) = 1

 ::)

Edt.. Which had a small error which should not be in there ( a^-b  = 1/a^b not a^-b = a/b ), even as of gibberish, let see if I would make another round with right start value (if one could even say it is more right than another, if undefined is calculated). Probably double the amusement, I think it will not give me piece until, but it needs to wait some food and beer is priority now. :P
« Last Edit: February 05, 2021, 08:08:14 pm by ArtLogi »
While Record is a drawer and method is a clerk, when both are combined to same space it forms an concept of office, which is alias for a great suffering.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6692
Re: Where could I find documentation on nan
« Reply #24 on: February 05, 2021, 07:16:30 pm »
Or maybe the system that defines it have flaws. But again I have not devoted my life to proof it to direction or another, not that a single life would be enough.  :D  Where on earth I have come across the Paranoia pascal source....

Here? http://www.netlib.no/netlib/paranoia/paranoia.p

See also https://archive.org/details/byte-magazine-1985-02/1985_02_BYTE_10-02_Computing_and_the_Sciences pp223-235 (Nota bene: 627Mb file).

I've extracted the relevant pages of the Byte edition above to a PDF, but it still comes to 7.4Mb which is too large to upload here. If anybody actually wants it please say and I'll hide it on my company website.

MarkMLl
« Last Edit: February 05, 2021, 08:09:37 pm by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Where could I find documentation on nan
« Reply #25 on: February 05, 2021, 07:49:40 pm »
Hi!

One can create a lot of theories about this topic.

As math is just an auxiliary science  for physics, you can look at it from the astrophysicians point of view:

What if 0 ^ 0 was just the moment of the Big Bang where 1=0  ????
A mini-minimum later everything is fine and solvable:

(1^-100 )   ^ (1^-100) has not that paradox problem anymore.
You can compute it. Not on a PC Proessor - but you can,

Winni

PS.: Nice song for this topic: "If 6 was 9", Jimi Hendrix

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Where could I find documentation on nan
« Reply #26 on: February 05, 2021, 08:47:05 pm »

Then drop in the non-zero zero and assume that all infinities do have same revision number (so ∞=∞ and argument of non-division do not apply, think we overwrite some of the parent methods here)

A) 0.0^0 = 1/∞ / 1/∞   
B) 1/∞//1/∞ = 1 /// 1/∞ // 1/∞

Lets rearrange the B as
B) 1/∞ * ∞/1 =  1 // 1/∞ * ∞/1


Sir!

Computing with infinity is forbidden.

Because as we all know:

Code: Text  [Select][+][-]
  1. ∞ + 23 = ∞

Winni

Paolo

  • Hero Member
  • *****
  • Posts: 510
Re: Where could I find documentation on nan
« Reply #27 on: February 05, 2021, 10:47:01 pm »
I think that some results are convension based on some usage, like 0!=1. In the specific case (a small number) ^ (a small number) is approaching 1, see image, so the limit case 0^0 goes to 1. Isn't the whole digital communication theory based on the sampling theorem itself based on sinc-function = sin(×)/× that souldn't be defined for x=0 ? (But lim(x->0) goes to 1 on both side). Some other convension are useful fo pc computation purpose like the esistence of -0.

BeniBela

  • Hero Member
  • *****
  • Posts: 908
    • homepage
Re: Where could I find documentation on nan
« Reply #28 on: February 06, 2021, 12:06:56 am »
There are many NaNs, you could put other data in it: https://leonardschuetz.ch/blog/nan-boxing/#nan-boxing

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Where could I find documentation on nan
« Reply #29 on: February 06, 2021, 12:19:05 am »
Hi!

Whatever is discussed and argued:

The problem is NOT solved until today.

The problem was first detected by french mathematician
Augustin-Louis Cauchy.

He stated in 1821 that 0 ^ 0 is undefined.

Donald "Latex" Knuth postulated in the 90s that 0 ^ 0 can't be undefined.

As math is just an auxiliary science  for physics I asked: Where in this universe you need to solve 0 ^ 0  for a real problem ????

I don't know one.

So this is just an operation mindfuck.

Winni

 

TinyPortal © 2005-2018