3 ms·
Huh. Most of those make sense to me, but infinity == infinity being true definitely feels like risky business. Algebraic limits is full of even some pretty triv
by mikepurvis 4y ago
Huh. Most of those make sense to me, but infinity == infinity being true definitely feels like risky business. Algebraic limits is full of even some pretty trivial scenarios where infinity divided by a lesser-infinity turns out to be a real number— those cases where the two infinities are definitely not equal to each other.
- MichaelMoser123 4y agoAlso: in javascript you can divide by zero > 1/0 Infinity But python throws a divide by zero error: >>> 1/0 Traceback (most recent call last): File "<stdin>", line 1, in <module> ZeroDivisionError: division by zero Still you do have infinity and nan in python - because these are part of the floating point spec. >>> float('inf') - float('inf') nan >>> float('inf') == float('inf') True >>> NAN=float('inf') - float('inf') >>> NAN == NAN False However that's not mathematics, it's computers (these are even stranger...) I have my own little programming language - PYX [1] - and i don't allow this madness (even if it is a violation of the floating point spec ;-) pyx > mathconst.Infinity - mathconst.Infinity Error: results in 'not a number' - that's not allowed here #(1) mathconst.Infinity - mathconst.Infinity |....................^ > 1/0 Error: Can't divide by zero #(1) 1/0 |..^ [1] PYX - https://github.com/MoserMichael/jscriptparse https://github.com/MoserMichael/jscriptparse - it's supposed to be an educational programming language, where I am trying to have detailed error messages, my side project.
- pclmulqdq 4y agoDividing by 0 or -0 is a valid floating-point operation because there's an infinity in the number system, and JS uses double precision floating point for all numbers. Python has an integer type and a double type, and division by 0 is disallowed for integers, but okay for doubles.
- MichaelMoser123 4y agoyour explanation makes sense, however python doesn't allow division of floating point number by 0 either: >>> type(1.0) <class 'float'> >>> 1.0/0 Traceback (most recent call last): File "<stdin>", line 1, in <module> ZeroDivisionError: float division by zero However numpy lets you do it - it is only a warning >>> import numpy as np >>> >>> np.divide(1.0,0) __main__:1: RuntimeWarning: divide by zero encountered in true_divide inf
- pclmulqdq 4y agoWow, Python really does hold your hand. >>> 1/0.0 Traceback (most recent call last): File "<stdin>", line 1, in <module> ZeroDivisionError: float division by zero >>> 1.0/0.0 Traceback (most recent call last): File "<stdin>", line 1, in <module> ZeroDivisionError: float division by zero
- hunter2_ 4y ago> those cases where the two infinities are definitely not equal to each other It's been a while since I was doing this in a classroom, but I feel like those things you're thinking are nonuniform infinities could just as well be thought of as entities comprised of infinity and a (perhaps implied) coefficient. Divide out infinity to reveal the coefficient. (And the same for powers/logs, etc.) In this model, infinities are indeed uniform (quite similar to a constant), though they are often augmented in any of infinitely many ways.