Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #6807

Re: float("nan") in set or as key

From "OKB (not okblacke)" <brenNOSPAMbarn@NObrenSPAMbarn.net>
Newsgroups comp.lang.python
Subject Re: float("nan") in set or as key
Date 2011-06-01 17:17 +0000
Organization A noiseless patient Spider
Message-ID <Xns9EF768C113385OKB@88.198.244.100> (permalink)
References <d63a1808-e704-4538-8541-9edeadab2135@glegroupsg2000goo.googlegroups.com>

Show all headers | View raw


Carl Banks wrote:

> On Tuesday, May 31, 2011 8:57:57 PM UTC-7, Chris Angelico wrote:
>> On Wed, Jun 1, 2011 at 1:30 PM, Carl Banks  wrote:
>> > I think you misunderstood what I was saying.
>> >
>> > It's not *possible* to represent a real number abstractly in any
>> > digita 
> l computer.  Python couldn't have an "abstract real number" type
> even it wanted to.
>> 
>> True, but why should the "non-integer number" type be floating
>> point rather than (say) rational? 
> 
> Python has several non-integer number types in the standard
> library.  The one we are talking about is called float.  If the
> type we were talking about had instead been called real, then your
> question might make some sense.  But the fact that it's called
> float really does imply that that underlying representation is
> floating point. 

    	That's true, but that's sort of putting the cart before the horse.  
In response to that, one can just ask: why is this type called "float"?  
Why is it that when I type 1.37 or sqrt(2) in my program, the resulting 
object is a "float" rather than some other numeric type?  I'm aware 
that there are answers to this having to do with standardization and 
efficiency.  But I do sometimes wish that the "default" type for non-
integers (as created through Python expressions) was something more like 
"rationals with a denominator no bigger than N".

-- 
--OKB (not okblacke)
Brendan Barnwell
"Do not follow where the path may lead.  Go, instead, where there is
no path, and leave a trail."
	--author unknown

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: float("nan") in set or as key Carl Banks <pavlovevidence@gmail.com> - 2011-05-31 23:09 -0700
  Re: float("nan") in set or as key "OKB (not okblacke)" <brenNOSPAMbarn@NObrenSPAMbarn.net> - 2011-06-01 17:17 +0000
  Re: float("nan") in set or as key Ethan Furman <ethan@stoneleaf.us> - 2011-06-01 11:10 -0700
    Re: float("nan") in set or as key Chris Torek <nospam@torek.net> - 2011-06-01 18:29 +0000

csiph-web