PEP 238 (revised)
Chris Barker
chrishbarker at home.net
Tue Jul 31 13:39:52 EDT 2001
Guido van Rossum wrote:
> Chris Barker <chrishbarker at home.net> writes:
> > [...] The problem, for me, is that
> > 1.0 can't be used as a sequence index. While it may not be know whether
> > x//y is an exact value, it IS know that it is an integer value, and
> > should therefor be usable as an index. This brings up the usefulness of
> > the concept of the inexact integer.
>
> Totally useless IMO -- and wrong. If it's inexact, that means it could
> really be any number inside some interval around the represented
> value, and thus by definition you can't tell whether it is an Integer
> at all.
If you used // or floor or ceil round, you KNOW that the result is an
integer. That's my whole point. I know it is an integer, I knwo that I
need it to be an integer, so why can't I use it like one? (as an index)
> > I'm also not so sure about your above rational: While I do understand
> > that the result of x//y may not be an exact number, given that x and/or
> > y may not be exact, the question is: does that matter? Acn anyone think
> > of a case where they would use // (or floor, or ceil, or round) when it
> > would hurt for the final result to be considered exact?
>
> When the width of the inexactness interval is larger than 1, there's
> more than one Integer that's the possible result, so we don't know the
> result exactly.
Well, sure, but I'm only talking about the result from some sort of
rounding operation. If you have an error bound that is +- > 1, then you
can't expect rounding to an integer to be useful. What I fail to see is
when it would be useful to use a rounding operation like // or round,
but harmful for the result to be treated like an exact integer. I only
suggested the idea of an inexact integer because I want to be able to
use the result as an index, but someone pointed out that it is not
neccessarily an exact result. I don't think I'd find it usefull, but I
don't know how others expect to use the exact flag.
-Chris
--
Christopher Barker,
Ph.D.
ChrisHBarker at home.net --- --- ---
http://members.home.net/barkerlohmann ---@@ -----@@ -----@@
------@@@ ------@@@ ------@@@
Oil Spill Modeling ------ @ ------ @ ------ @
Water Resources Engineering ------- --------- --------
Coastal and Fluvial Hydrodynamics --------------------------------------
------------------------------------------------------------------------
More information about the Python-list
mailing list