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


Groups > comp.arch > #1577

Re: Computer arithmetic problems worth exploring

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.16.MISMATCH!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date Sat, 14 May 2011 18:58:45 -0500
Message-ID <4DCF1735.9050107@SPAM.comp-arch.net> (permalink)
Date Sat, 14 May 2011 16:58:45 -0700
From "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net>
Reply-To andy@SPAM.comp-arch.net
Organization comp-arch.net
User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.11) Gecko/20101013 Thunderbird/3.1.5
MIME-Version 1.0
Newsgroups comp.arch
Subject Re: Computer arithmetic problems worth exploring
References <ikaggo$mi2$1@gosset.csi.cam.ac.uk> <4DCCA37C.6090505@SPAM.comp-arch.net> <iqir93$r64$1@gosset.csi.cam.ac.uk> <5afv98-e0u2.ln1@ntp6.tmsw.no> <iqj0va$ss2$1@gosset.csi.cam.ac.uk> <4a613763-70c7-4a66-aa75-7ce3476cddd3@x10g2000yqj.googlegroups.com>
In-Reply-To <4a613763-70c7-4a66-aa75-7ce3476cddd3@x10g2000yqj.googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Lines 53
X-Usenet-Provider http://www.giganews.com
X-Trace sv3-SWodNfeY6gj4gijEQspwdM4wfEc4vDy6uJasiAdMxHmX9Ap6RQRiSlBkhxnR4Hi2bGL+70fVZHZQ/g6!PxfxK8aTtziIC6/Kbh6Z8Bvdxt2s9GZxnmrGKBkUVvP11/nW2xyKhpSufvtF
X-Complaints-To abuse@giganews.com
X-DMCA-Notifications http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 3072
Xref x330-a1.tempe.blueboxinc.net comp.arch:1577

Show key headers only | View raw


On 5/13/2011 8:57 AM, MitchAlsup wrote:
> On May 13, 5:25 am, n...@cam.ac.uk wrote:
>> In article<5afv98-e0u2....@ntp6.tmsw.no>,
>>> Afair the idiom of "if ((0<  x) || (0>= x)) {" has been used in a bit
>>> of code to determine that (x) is a regular number, not a NaN. It does of
>>> course depend on both comparisons to fail when x is indeed NaN.
>>
>> Yes, they have.  That's not the point.
>
> It seems to me that the inherent problem, here, is ::
>
> "What is to be the effect of comparing things that are incomparable"?
>
> Perhaps one should resurect the old FORTRAN IF and add a 4'th lable
>
> 100  IF(X.NE.Y) 1,2,3,4
>
> Where the 4'th label is delivered control if the operands are
> incomparible.
>
> This seems to be at least as much a language issue as a HW
> computational issue.
>
> Mitch

My thinking along this line is that if you an ordered comparison of 
NaNs, then it should fault.

E.g.  if(x>y){... should fault if either x or y is a NaN.

You should say if(isnan(x)){...}else if(isnan(y)){...}else if( x<y) {...

But, there are many idioms such as Terje mentioned: !(x<0||x>=0).
Deprecated compiler switch.

I also like the symbolic notations  ?>?, ?>, >?,
which are read as if( lhs is nan or greater than rhs ), etc.

Methinks also, if serious, then the FP compare should be a bitmask:

LT
EQ
GT
isnan(lhs)
isnan(rhs)

although I expect the usual attempts to

a) reduce the bits in the bitmask by arguing that certain combinations
are meaningless

b) complicate it by adding not and and and or combinations relating to 
the nans

Back to comp.arch | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Computer arithmetic problems worth exploring George Neuner <gneuner2@comcast.net> - 2011-05-07 03:06 -0400
  Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-07 09:44 +0100
    Re: Computer arithmetic problems worth exploring Tom Gardner <spamjunk@blueyonder.co.uk> - 2011-05-07 11:38 +0100
      Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-07 12:21 +0100
        Re: Computer arithmetic problems worth exploring Tom Gardner <spamjunk@blueyonder.co.uk> - 2011-05-07 13:47 +0100
          Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-07 09:55 -0700
            Re: Computer arithmetic problems worth exploring Tom Gardner <spamjunk@blueyonder.co.uk> - 2011-05-07 19:27 +0100
              Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-07 13:54 -0700
                Re: Computer arithmetic problems worth exploring George Neuner <gneuner2@comcast.net> - 2011-05-09 13:38 -0400
                Re: Computer arithmetic problems worth exploring Robert A Duff <bobduff@shell01.TheWorld.com> - 2011-05-10 12:40 -0400
                Re: Computer arithmetic problems worth exploring Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-05-10 20:32 +0200
            Re: Computer arithmetic problems worth exploring torbenm@diku.dk (Torben Ægidius Mogensen) - 2011-05-09 13:42 +0200
    Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-07 04:26 -0700
      Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-07 12:13 +0100
  Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-07 14:59 -0700
    Re: Computer arithmetic problems worth exploring George Neuner <gneuner2@comcast.net> - 2011-05-09 14:14 -0400
      Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-09 20:38 +0100
      Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-09 13:55 -0700
        Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-10 09:05 +0100
          Re: Computer arithmetic problems worth exploring Jason Riedy <jason@lovesgoodfood.com> - 2011-05-10 13:24 -0400
            Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-10 18:41 +0100
            Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-11 13:56 -0700
            Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-11 14:04 -0700
            Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-11 14:06 -0700
          Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-11 13:55 -0700
            Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-11 22:15 +0100
              Re: Computer arithmetic problems worth exploring Tom Gardner <spamjunk@blueyonder.co.uk> - 2011-05-12 20:52 +0100
                Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-12 20:20 +0100
                Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-12 14:55 -0700
                Re: Computer arithmetic problems worth exploring Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-05-13 12:25 +0200
                Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-13 11:18 +0100
                Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-14 13:19 -0700
                Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-14 19:11 -0700
              Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-12 20:08 -0700
            Re: Computer arithmetic problems worth exploring Jason Riedy <jason@lovesgoodfood.com> - 2011-05-12 23:54 -0400
        Re: Computer arithmetic problems worth exploring George Neuner <gneuner2@comcast.net> - 2011-05-12 01:08 -0400
          Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-12 09:27 +0100
            Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-12 05:41 -0700
              Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-12 13:22 +0100
                Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-12 07:22 -0700
                Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-12 14:58 +0100
                Re: Computer arithmetic problems worth exploring MitchAlsup <MitchAlsup@aol.com> - 2011-05-12 09:23 -0700
                Non-constant initializers Fred the Freshwater Catfish <usenet.fred@bdtd.invalid> - 2011-05-12 22:59 +0000
                Re: Non-constant initializers Ian Collins <ian-news@hotmail.com> - 2011-05-13 11:07 +1200
                Re: Non-constant initializers Fred the Freshwater Catfish <usenet.fred@bdtd.invalid> - 2011-05-12 23:17 +0000
                Re: Non-constant initializers Ian Collins <ian-news@hotmail.com> - 2011-05-13 11:20 +1200
                Re: Non-constant initializers Fred the Freshwater Catfish <usenet.fred@bdtd.invalid> - 2011-05-12 23:30 +0000
                Re: Non-constant initializers Ian Collins <ian-news@hotmail.com> - 2011-05-13 11:34 +1200
                Re: Non-constant initializers Keith Thompson <kst-u@mib.org> - 2011-05-12 16:52 -0700
                Re: Non-constant initializers Fred the Freshwater Catfish <usenet.fred@bdtd.invalid> - 2011-05-14 00:13 +0000
                Re: Non-constant initializers kym@kymhorsell.com - 2011-05-14 01:54 +0000
                Re: Non-constant initializers Columbus sailed the ocean China Blue <chine.bleu@yahoo.com> - 2011-05-14 01:07 -0700
                Re: Non-constant initializers kym@kymhorsell.com - 2011-05-14 09:22 +0000
                Re: Non-constant initializers Fred the Freshwater Catfish <usenet.fred@bdtd.invalid> - 2011-05-14 17:14 +0000
                Re: Non-constant initializers Fred the Freshwater Catfish <usenet.fred@bdtd.invalid> - 2011-05-14 00:11 +0000
                Re: Non-constant initializers Columbus sailed the ocean China Blue <chine.bleu@yahoo.com> - 2011-05-12 16:15 -0700
                Re: Non-constant initializers Fred the Freshwater Catfish <usenet.fred@bdtd.invalid> - 2011-05-12 23:28 +0000
                Re: Non-constant initializers Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-05-12 18:01 -0600
                Re: Non-constant initializers Keith Thompson <kst-u@mib.org> - 2011-05-12 18:15 -0700
                Re: Non-constant initializers Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-05-12 22:56 -0600
                Re: Non-constant initializers Seebs <usenet-nospam@seebs.net> - 2011-05-13 05:18 +0000
                Re: Non-constant initializers Fred the Freshwater Catfish <usenet.fred@bdtd.invalid> - 2011-05-13 23:57 +0000
            Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-12 20:20 -0700
              Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-13 09:48 +0100
                Re: Computer arithmetic problems worth exploring Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-05-13 12:55 +0200
                Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-13 11:25 +0100
                Re: Computer arithmetic problems worth exploring MitchAlsup <MitchAlsup@aol.com> - 2011-05-13 08:57 -0700
                Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-13 16:42 +0100
                Re: Computer arithmetic problems worth exploring MitchAlsup <MitchAlsup@aol.com> - 2011-05-13 13:17 -0700
                Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-13 21:03 +0100
                Re: Computer arithmetic problems worth exploring Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-05-14 06:43 +0200
                Re: Computer arithmetic problems worth exploring Tom Gardner <spamjunk@blueyonder.co.uk> - 2011-05-14 06:55 +0100
                Re: Computer arithmetic problems worth exploring "Ken Hagan" <k.hagan@thermoteknix.com> - 2011-05-17 12:59 +0100
                Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-17 12:44 +0100
                Re: Computer arithmetic problems worth exploring Tom Gardner <spamjunk@blueyonder.co.uk> - 2011-05-17 14:07 +0100
                Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-17 17:20 +0100
                Re: Computer arithmetic problems worth exploring "Ken Hagan" <k.hagan@thermoteknix.com> - 2011-05-17 15:03 +0100
                Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-14 08:43 +0100
                Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-14 09:17 +0100
                Re: Computer arithmetic problems worth exploring Stephen Fuld <SFuld@alumni.cmu.edu.invalid> - 2011-05-14 09:04 -0700
                Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-14 17:00 -0700
                Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-14 16:58 -0700
                Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-14 19:07 -0700
                Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-15 09:40 +0100
                Re: Computer arithmetic problems worth exploring Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-05-16 11:05 +0200
                Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-16 06:44 -0700
                Re: Computer arithmetic problems worth exploring mac <acolvin@efunct.com> - 2011-05-19 20:17 +0000
                Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-19 15:20 -0700
                Re: Computer arithmetic problems worth exploring George Neuner <gneuner2@comcast.net> - 2011-05-19 18:51 -0400
                Re: Computer arithmetic problems worth exploring Petter Gustad <newsmailcomp6@gustad.com> - 2011-05-20 08:01 +0200
                Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-20 15:09 -0700
                Re: Computer arithmetic problems worth exploring Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-05-20 08:54 +0200
                Re: Computer arithmetic problems worth exploring "Ken Hagan" <k.hagan@thermoteknix.com> - 2011-05-23 11:11 +0100
                Re: Computer arithmetic problems worth exploring George Neuner <gneuner2@comcast.net> - 2011-05-23 18:20 -0400
                Re: Computer arithmetic problems worth exploring Morten Reistad <first@last.name> - 2011-06-03 08:21 +0200
                Re: Computer arithmetic problems worth exploring Stephen Fuld <SFuld@alumni.cmu.edu.invalid> - 2011-05-19 13:31 -0700
                Re: Computer arithmetic problems worth exploring Stephen Fuld <SFuld@alumni.cmu.edu.invalid> - 2011-05-16 09:05 -0700
                Re: Computer arithmetic problems worth exploring Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-05-16 22:37 +0200
                Re: Computer arithmetic problems worth exploring Stephen Fuld <SFuld@alumni.cmu.edu.invalid> - 2011-05-18 23:16 -0700
                Re: Computer arithmetic problems worth exploring ChrisQ <meru@devnull.com> - 2011-05-17 17:10 +0100
                Re: Computer arithmetic problems worth exploring Tom Gardner <spamjunk@blueyonder.co.uk> - 2011-05-17 17:27 +0100
                Re: Computer arithmetic problems worth exploring ChrisQ <meru@devnull.com> - 2011-05-17 23:08 +0100
                Re: Computer arithmetic problems worth exploring Tom <tggzzz@blueyonder.co.uk> - 2011-05-17 22:37 +0000
                Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-18 09:25 +0100
                Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-18 06:25 -0700
                Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-18 14:06 +0100
                Re: Computer arithmetic problems worth exploring Tom Gardner <spamjunk@blueyonder.co.uk> - 2011-05-18 19:23 +0100
                Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-18 13:48 -0700
                Re: Computer arithmetic problems worth exploring Andrew Reilly <areilly---@bigpond.net.au> - 2011-05-19 00:29 +0000
                Re: Computer arithmetic problems worth exploring "Ken Hagan" <k.hagan@thermoteknix.com> - 2011-05-19 13:12 +0100
                Re: Computer arithmetic problems worth exploring Stephen Fuld <SFuld@alumni.cmu.edu.invalid> - 2011-05-18 23:27 -0700
                Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-19 15:19 -0700
                Re: Computer arithmetic problems worth exploring Stephen Fuld <SFuld@alumni.cmu.edu.invalid> - 2011-05-20 07:33 -0700
                Re: Computer arithmetic problems worth exploring Michael S <already5chosen@yahoo.com> - 2011-05-16 03:14 -0700
                Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-16 10:43 +0100
                Re: Computer arithmetic problems worth exploring Michael S <already5chosen@yahoo.com> - 2011-05-16 04:58 -0700
                Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-16 12:40 +0100
                Re: Computer arithmetic problems worth exploring MitchAlsup <MitchAlsup@aol.com> - 2011-05-15 10:12 -0700
                Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-14 13:22 -0700
                Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-15 09:02 +0100
                Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-14 14:02 -0700
          Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-12 20:18 -0700
      Re: Computer arithmetic problems worth exploring Robert Myers <rbmyersusa@gmail.com> - 2011-05-09 14:32 -0700
        Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-09 16:08 -0700

csiph-web