If min is a smallest number, why 1/min is not "infinity"?

Hi,
I am reading "Infinite Powers-Steven Strogatz" and I was able to explain to my 13 year old nephew how to understand infinity. Here is the explanation of Steven Strogatz:

And I wanted to quickly show that in Snap! For that I wrote a program: Snap! Build Your Own Blocks
Snap program:
snap_prog

Quick output from snap:
snap_infinity

To replicate the same thing, if my minimum number is min, and I am able to get "infinity" when I calculate 1/min, that would have served my purpose. But, I see the the approximate minimum(min) in Snap! as 1e-9, so 1/min can never be infinity.
Any thoughts are welcome?
Thanks a lot!
Nisar
PS: This is what python says:
python_infinity

Wouldn't you get ZeroDivisionError there? I don't understand how you're not getting an error. I just realized before is bigger than f, that's why.

Edit:

Python 3.7.8 (tags/v3.7.8:4b47a5b6ba, Jun 28 2020, 08:53:46) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> f = 1.0
>>> while f:
	before = f
	f = f/10.0

>>> before
1e-323
>>> 1/before
inf
>>> 

I got the same result as you. But:

>>> 1/0
Traceback (most recent call last):
  File "<pyshell#7>", line 1, in <module>
    1/0
ZeroDivisionError: division by zero
>>> 

I did exactly what you did in Python but in Snap!, and I got untitled script pic (52), the same result as in Python. And:
untitled script pic (53)
But:
untitled script pic (54)

Please run the program in the link above and also look at the code...
Can you please share your program ?

Here's my code:
untitled script pic (55)
And my project: Here

Sorry. I checked it and it is not working as you said...

niscar's program worked fine for me. Could it depend upon the OS and/or browser? Unlikely since JavaScript is pretty standardized these days.

Probably OS. 32-bit, 64-bit etc. I'm on a 64-bit Windows 10, my browser is Chrome.

Another observation:you can see the variable value of "before" on the right but in the script page it is something else...

The "1e-323" is the correct one. Variable watchers round the result.

Thank you very much! I never knew about "variable watchers" rounding and also the other way around(double clicking) to get the value of the variable...

Double clicking? You only need to click once on the variable reporter.

My mistake...Thank you again!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.