News for hackers. Stuff that matters.
Re:If 1+x is 1, how much is 1-x? by thomasahle on Tuesday April 21, 2015 @04:31PM (#9416860)
Here is a nice challenge: Just like we have arbitrary precision integers (allocating more memory as needed) and arbitrary precision "fractional numbers", design a library providing arbitrary precision "computable numbers".
Re:If 1+x is 1, how much is 1-x? by tel on Tuesday April 21, 2015 @06:21PM (#9417528)
An obvious representation is a convergent stream of fractions. This will also quickly drive home why you cannot implement equality.

The other obvious representation is that of first order formulae over the theory of real fields, but then you need to check equivalence of arbitrary formulae. You ultimately need a limit operation to be included and now you're sunk. You'll also probably wish you were implementing the complex numbers instead pretty quickly.

Re:If 1+x is 1, how much is 1-x? by kenj0418 on Tuesday April 21, 2015 @04:57PM (#9417035)
> design a library providing arbitrary precision "computable numbers"

I believe they call those "programming languages"

Re:If 1+x is 1, how much is 1-x? by scarmig on Tuesday April 21, 2015 @05:25PM (#9417234)
Naive question:

Programs written in programming languages aren't guaranteed to terminate. Computable numbers, however, are all real numbers that can be represented to arbitrary precision by a computation that terminates. Wouldn't that mean we don't need a fully fledged programming language to have the capability to represent all computable numbers?

Somewhere in there is the idea we just need a program that determines whether an arbitrary program terminates or not...

Re:If 1+x is 1, how much is 1-x? by mkehrt on Tuesday April 21, 2015 @08:48PM (#9418058)
I can't tell how much of this is a joke, but, yes, it turns out you can't write such a programming language for exactly the reason you allude to: you can't tell whether a given number is computable in finite time, as you don't know whether your program will terminate.
Re:If 1+x is 1, how much is 1-x? by Shyis on Tuesday April 21, 2015 @04:53PM (#9417008)
This is a neat idea! Although I'd imagine that it'd quickly approach the power of a full computer algebra system.