🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.lib.bug
Article #362

Re: problems with g++-2.3.1, libg++-2.2, vax-ultrix

#362
From: bothner
Date: Sun, 22 Nov 1992 15:52
34 lines
1614 bytes
> i've a problem in the libg++-2.2 test suite (rationals test) -
> the problem occurs only on vax-ultrix.

> what is the error and how can i solve it??

As far as I know, there is no error (except perhaps in the test itself).

The problem is that VAX floating-point uses a non-IEEE representation.
The problemantical tests involve converting (double) to Rationals.
The exact result will depend somewhat on floating-point representation.

Consider:
	8c8
	< onePointTwo = 5404319552844595/4503599627370496
	---
	> onePointTwo = 21617278211378381/18014398509481984

Using my 'Q' interpreter, I get:

	Q4> 5404319552844595/4503599627370496 * 1.0
	1.2
	Q5> 21617278211378381/18014398509481984 * 1.0
	1.2

So both results are actually correct.

Arguably, the tests should be re-written to be less sensitive
to floating-point representations.  I.e. one could take the
Rational, multiply by 1000, round to an integer, and then
divide by 1000, before printing the result.  I don't care
enough to do this myself, but I would consider patches to do so.

	--Per Bothner
Cygnus Support     bothner@cygnus.com
Technical Details
Message-ID: <9211230752.AA09028@cygnus.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cygnus.com!bothner
References: <1992Nov22.123804.19791@uropax.contrib.de>

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.lib.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cygnus.com!bothner
From: bothner@cygnus.com
Subject: Re: problems with g++-2.3.1, libg++-2.2, vax-ultrix
Message-ID: <9211230752.AA09028@cygnus.com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
References: <1992Nov22.123804.19791@uropax.contrib.de>
Distribution: gnu
Date: Sun, 22 Nov 1992 15:52:30 GMT
Approved: bug-lib-g++@prep.ai.mit.edu
Lines: 35