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

Re: Nitpick with FLOOR etc.

This page is part of the web mail archives of SRFI 70 from before July 7th, 2015. The new archives for SRFI 70 contain all messages, not just those from before July 7th, 2015.

On Sun, 24 Jul 2005, Aubrey Jaffer wrote:

> | Date: Thu, 21 Jul 2005 20:50:05 -0400
> | From: Paul Schlie <schlie@xxxxxxxxxxx>
> |
> | or exact semantics; I don't believe it's reasonably possible, as it
> | seems that the only way to achieve what you desire, and maintain
> | reasonable consistency with mixed exact/inexact arithmetic would be
> | to:

> | - as suggested by "bear", define the requirement that exact and
> | inexact value representations be constrained to the same value
> | range.

> I am reluctant to take that measure unless someone can provide an
> example from practice where the ranges being unequal caused bad
> software behavior.

The comment was made half in jest; but the observation is
that many of the inconsistencies of infinity mathematics
are predicated on the fact that inexact math invokes infinity
while exact math just goes to bigger exact numbers.

In practical terms, I think that "infinity" as it's being
discussed here is properly an error object rather than a
numeric value, and I would be satisfied with a scheme
where numeric operations returned an error object if asked
to do anything involving a range overflow, underflow, or
where an argument were an error object.  But naming an
error object "infinity" is misleading, since the value the
user sees may be nine or ninety operations further down
the pipeline after the "overflow" has been divided,
subtracted, inverted, etc.

> | - define infinites and their reciprocals to abstractly commonly
> | represent the greatest/smallest values at bounds of the
> | representable numerical range,

> As I written previously, using the boundary for the nominal value is
> the worst choice from that neighborhood.  Doing so means that nearly
> every calculation which projects into #i+/0 is larger than the nominal
> value.

Agreed.  This produces truly execrable behavior and should not
be done.

> | exclusive of 0 representing an absolute 0, who's reciprocal is
> | itself 0.

> This would mean (* 0 (/ 0)) would no longer signal an error or return
> 0/0.  What would (/ 0 0) do?  What would (/ 0.0) return (exact or
> inexact)?  (/ 0 0.0)?

I think that:
 (/ 0) => error-object  ;; this EO could be called infinity, I guess
 (* 0 error-object) => error-object  ;; but not this one.

This brings up an important distinction in "infinities;"
When you divide by exact zero you get an absolute infinity.
(which, perversely, is neither positive nor negative, because
exact zero isn't positive or negative.) Call this EO1.

When you divide 1 by (say) 5e-323, you get a different kind of
EO, which is "results too large to represent" but which
is often mistaken for an actual infinity.   Call this EO2.

The kick is that (* 0 EO1) => EO3  ;; EO3 is a NaN or something.
while (* 0 E02) => 0 .

Modeling this behavior in programming language mathematics is
not simple.