osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can math.atan2 return INF?


On Tuesday, June 28, 2016 at 11:42:29 AM UTC+5:30, Gregory Ewing wrote:
> Rustom Mody wrote:
> > I said that for the Haskell list [0..]
> > 
> > [0..] ++ [-1] == [0..]
> > 
> > He said (in effect) yes that -1 would not be detectable but its still there!
> 
> The code to generate it is there, but it will never
> be executed, so the compiler is entitled to optimise
> it away. :-)
> 
> He may have a point though. There are avenues of
> mathematics where people think about objects such
> as "all the natural numbers, followed by -42", and
> consider that to be something different from just
> "all the natural numbers".
> 
> So, a mathematician would probably say they're not
> equal. A scientist would say they may or may not be
> equal, but the difference is not testable.
> 
> An engineer would say "Lessee, 0, 1, 2, 3, 4, 5,
> 6, 7... yep, they're equal to within measurement
> error."

Yes there is a sloppiness in my statement above:

[0..] ++ [-1] == [0..]

What kind of '==' is that?
If its the Haskell (or generally, programming language implementation) version
that expression just hangs trying to find the end of the infinite lists.

If its not then a devil's advocate could well say:
"So its metaphysical, theological and can know the unknowable,
viz. that that -1 which is computationally undetectable is nevertheless present.

ie the '++' can be a lazy Haskell *implemented* function
The '==' OTOH is something at least quasi mystical

Mathematicians are more likely to say 'mathematical' than 'mystical'
Such mathematicians -- the majority -- are usually called 'Platonists'