News for hackers. Stuff that matters.
Re:Seemingly impossible functional programs (2007) by JadeNB on Friday July 10, 2020 @11:54PM (#23799324)
The example you suggest has a subtle issue, since the number 0.999… is the number 1; so a program fed numbers (rather than, say, decimal strings, in which case the domain is no longer [0, 1]) cannot meaningfully distinguish the former from the latter, and hence cannot terminate on 1.
Re:Seemingly impossible functional programs (2007) by contravariant on Saturday July 11, 2020 @12:24PM (#23803289)
I did use the phrase decimal representations to avoid that exact issue.
Re:Seemingly impossible functional programs (2007) by JadeNB on Saturday July 11, 2020 @02:59PM (#23804749)
Right, but then the domain isn't [0, 1] any more (it's got lots of double points, like 0.999… and 1, and 0.8999… and 0.9 etc.), and your function doesn't terminate on input 0.999….

I guess you meant to feed only the terminating decimal if there was one? Then, I agree, this is a good illustration of how a discontinuous function can violate all the nice properties on which the mathematics of functional programming relies.