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


Groups > comp.lang.c++ > #15025

Re: Setting floating point variable as infinite

From Rui Maciel <rui.maciel@gmail.com>
Newsgroups comp.lang.c++
Subject Re: Setting floating point variable as infinite
Date 2012-03-24 11:43 +0000
Organization Aioe.org NNTP Server
Message-ID <jkkc0e$9cp$1@speranza.aioe.org> (permalink)
References (1 earlier) <jki1h5$q44$1@dont-email.me> <jki3bh$1p7$1@speranza.aioe.org> <jki63p$mn6$1@dont-email.me> <jkihae$8ru$1@speranza.aioe.org> <jkivsk$omf$1@dont-email.me>

Show all headers | View raw


Victor Bazarov wrote:

> Failed?  Maybe.  Intentionally?  You know what, if you're having a bad
> day, why are you trying to blame me for that?  Snap at somebody who
> actually gives a damn.

If you express disdain towards others you shouldn't be surprized that people 
don't react kindly to that.


<snip/>
>> Then, I asked if it was a good idea to do this.  In other words, if there
>> was any reason that would made it a bad idea.  Until now, no reason has
>> been given.
> 
> Why would a solution that works be a bad idea?  Since you didn't state
> the complexity of your 'operator', we could presume that it's expensive.
>   Then the only concern is efficiency.

The complexity of any hypothetical operator is irrelevant to this 
discussion.  If you read the thread, or even just the subject, you will 
realize that the issue under discussion refers to the use of infinite values 
in a particular floating point operation. 


> The pseudo code has two inefficiencies.  First, it initializes 'minimum'
> to some value, and immediately overrides it with the
> 'operator(element#0)'.  

I believe we can agree that discussing the perceived efficiency of a pseudo-
code snippet is silly, particularly when the perceived inefficiency boils 
down to a single floating point assignment executed only once at the start 
of a iteration through an undetermined number of elements in a set.


> Second inefficiency is that it evaluates the
> 'operator' for each element twice.

I was aware of that when I wrote the pseudo-code, but, again, it is pseudo-
code and nothing more than that, and has nothing to do with the topic of 
this discussion, which is the reliance of infinite values in floating point 
operations.


> Simple as that.

Too bad it doesn't have anything to do with the topic being discussed.


Rui Maciel

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Setting floating point variable as infinite Rui Maciel <rui.maciel@gmail.com> - 2012-03-23 12:27 +0000
  Re: Setting floating point variable as infinite Marc <marc.glisse@gmail.com> - 2012-03-23 12:34 +0000
    Re: Setting floating point variable as infinite glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-03-23 12:39 +0000
      Re: Setting floating point variable as infinite gwowen <gwowen@gmail.com> - 2012-03-23 06:21 -0700
      Re: Setting floating point variable as infinite Rui Maciel <rui.maciel@gmail.com> - 2012-03-23 14:39 +0000
        Re: Setting floating point variable as infinite glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-03-23 20:06 +0000
  Re: Setting floating point variable as infinite Victor Bazarov <v.bazarov@comcast.invalid> - 2012-03-23 10:32 -0400
    Re: Setting floating point variable as infinite Rui Maciel <rui.maciel@gmail.com> - 2012-03-23 15:03 +0000
      Re: Setting floating point variable as infinite Victor Bazarov <v.bazarov@comcast.invalid> - 2012-03-23 11:50 -0400
        Re: Setting floating point variable as infinite Rui Maciel <rui.maciel@gmail.com> - 2012-03-23 19:01 +0000
          Re: Setting floating point variable as infinite Christian Gollwitzer <auriocus@gmx.de> - 2012-03-23 20:26 +0100
          Re: Setting floating point variable as infinite Victor Bazarov <v.bazarov@comcast.invalid> - 2012-03-23 19:10 -0400
            Re: Setting floating point variable as infinite Rui Maciel <rui.maciel@gmail.com> - 2012-03-24 11:43 +0000
        Re: Setting floating point variable as infinite Miles Bader <miles@gnu.org> - 2012-03-24 09:46 +0900
          Re: Setting floating point variable as infinite Victor Bazarov <v.bazarov@comcast.invalid> - 2012-03-23 23:42 -0400
            Re: Setting floating point variable as infinite Rui Maciel <rui.maciel@gmail.com> - 2012-03-24 11:31 +0000
            Re: Setting floating point variable as infinite Miles Bader <miles@gnu.org> - 2012-03-24 23:41 +0900
    Re: Setting floating point variable as infinite Andrea Venturoli <ml.diespammer@netfence.it> - 2012-03-24 13:05 +0100
      Re: Setting floating point variable as infinite Victor Bazarov <v.bazarov@comcast.invalid> - 2012-03-24 15:44 -0400
  Re: Setting floating point variable as infinite Leigh Johnston <leigh@i42.co.uk> - 2012-03-24 12:30 +0000
    Re: Setting floating point variable as infinite Gareth Owen <gwowen@gmail.com> - 2012-03-25 07:52 +0100
    Re: Setting floating point variable as infinite Rui Maciel <rui.maciel@gmail.com> - 2012-03-25 12:38 +0100
      Re: Setting floating point variable as infinite Leigh Johnston <leigh@i42.co.uk> - 2012-03-25 13:36 +0100
        Re: Setting floating point variable as infinite Leigh Johnston <leigh@i42.co.uk> - 2012-03-25 14:00 +0100
          Re: Setting floating point variable as infinite Leigh Johnston <leigh@i42.co.uk> - 2012-03-25 14:05 +0100
            Re: Setting floating point variable as infinite Rui Maciel <rui.maciel@gmail.com> - 2012-03-25 16:54 +0100

csiph-web