[r6rs-discuss] Hashes in the number syntax

From: Eli Barzilay <eli>
Date: Wed Nov 22 11:42:15 2006

On Nov 22, Peter Gavin wrote:
> I don't think anyone's mentioned the affect uncertainty in numbers
> has on numerical operations. If two uncertain measurements are
> taken, and a computation is performed with them, the result should
> carry over the uncertainty from the original measurements. For
> example, (+ 123#.# 1542.#) should have the result 277#.#. I haven't
> seen any implementation actually *do* something like this, but I
> think it would be the most correct way to do it.

A *proper* implementation of this should not be limited to this
oversimplified "unspecified numerals" thing. In your example, the
result is not in the [2770-2780) range, it should be [2772-2783), and
if you can only represent uncertain digits, then it must be 27##.#.

But that's *still* not the whole story -- what about distributions?
Whatever you think 1##.# is, it is different from
(/ (+ 1##.# 1##.#) 2).

But, if you want to be *realy* pedantic, then you should really say
that:

  (let ([x 1##.#]) (/ (+ x x) 2)) = 1##.#
  != (/ (+ 1##.# 1##.#) 2) = (let ([x 1##.#] [y 1##.#]) (/ (+ x y) 2))

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!
Received on Wed Nov 22 2006 - 11:42:08 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:00 UTC