home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!mips!zaphod.mps.ohio-state.edu!uwm.edu!bionet!raven.alaska.edu!news.u.washington.edu!hardy.u.washington.edu!rons
- From: rons@hardy.u.washington.edu (Ronald Schoenberg)
- Newsgroups: comp.lang.c++
- Subject: Re: Power Operator vs NANs
- Message-ID: <1992Jul21.204639.2327@u.washington.edu>
- Date: 21 Jul 92 20:46:39 GMT
- References: <1992Jul15.123527.3771@bnr.co.uk> <850@nazgul.UUCP> <TMB.92Jul21152204@arolla.idiap.ch>
- Sender: news@u.washington.edu (USENET News System)
- Organization: University of Washington, Seattle
- Lines: 48
-
- In article <TMB.92Jul21152204@arolla.idiap.ch> tmb@idiap.ch writes:
- >In article <850@nazgul.UUCP> bright@nazgul.UUCP (Walter Bright) writes:
- >
- > C++ has abandoned ones-complement hardware and 6-char linkers, that C
- > was unwilling to leave behind. Maybe it is time to leave behind non-IEEE
- > floating point too.
- >
- >C++ does not specify how integer arithmetic is to be performed on the
- >machine. And, personally, I don't think it's time to leave behind
- >non-IEEE floating point.
- >
- [elision]
- >
- >There is a nice middle road. You can use functional/macro syntax
- >(isnan(x), isinf(x), ...) to denote standardized IEEE floating point
- >operations. Such notation is straighforward, simple, and easy to
- >implement even in existing compilers. Via the usual "#define foo(x)
- >__foo(x)" trick, you can get macro semantics (i.e., you don't get the
- >feature unless you #include the header file) with the efficiency and
- >flexibility of a language extension.
- >
- > For instance, only Zortech's compiler correctly (IEEE 754) implements
- > == and != (others set the exception bits incorrectly if one operand
- > is a NAN). Do you really want to do isequal(a,b) instead of a==b?
- >
- >I would want neither. The behavior of operator== on NaN's should be
- >left undefined. If you care to know whether operator== is operating on
- >a NaN, you should simply test beforehand:
- >
- > if(isnan(x)||isnan(y)) { ... }
- > else if(x==y) { ... }
- >
- >Sadly, this is a losing battle. NCEG seems to be determined to go down
- >this route of adding lots of IEEE specific, complicated, useless
- >operators, and the C++ language is likely to follow suite.
- >
- > Thomas.
-
- I'm not sure I understand - why is better to leave the effect of NaN's
- on operator == undefined? Why do you see NCEG as losing battle?
- What do you really have against adding features that would benefit
- people like me who are doing numerics programming? Your note seems to
- assume that I would know why "it's not time to leave behind non-IEEE
- floating point. What exactly do non-numerics programmers have to lose
- with IEEE floating point? Maybe Walter Bright could tell us what the
- reaction is to Zortech C++. Is there a deluge of criticism from
- non-numerics programmers? Or maybe they aren't even aware of (and
- don't care about) the NCEG extensions. And maybe the numerics
-