Status: Read
Received: from [207.113.13.68] by phillip.cerious.com (NTMail 3.03.0017/7.aaxh) with ESMTP id pcrews for <pcrews@cerious.com>; Mon, 21 Jun 1999 02:10:57 -0400
Received: from localhost (bin@localhost)
	by gate7.olympiakos.com (8.8.7/8.8.7) with SMTP id BAA23321;
	Mon, 21 Jun 1999 01:54:07 -0400
Received: by gate7.olympiakos.com (bulk_mailer v1.9); Mon, 21 Jun 1999 01:53:52 -0400
Received: (from majordom@localhost)
	by gate7.olympiakos.com (8.8.7/8.8.7) id BAA23299
	for tiff-outgoing; Mon, 21 Jun 1999 01:53:52 -0400
X-Authentication-Warning: gate7.olympiakos.com: majordom set sender to owner-tiff@olympiakos.com using -f
Received: from dms.corena.no (dms.corena.no [193.69.46.253])
	by gate7.olympiakos.com (8.8.7/8.8.7) with SMTP id BAA23296
	for <tiff@olympiakos.com>; Mon, 21 Jun 1999 01:53:49 -0400
Received: from senja.corena.no by dms.corena.no (AIX 3.2/UCB 5.64/4.03)
          id AA15132; Mon, 21 Jun 1999 07:53:43 +0200
Received: by senja.corena.no (AIX 3.2/UCB 5.64/4.03)
          id AA17900; Mon, 21 Jun 1999 07:53:42 +0200
From: brox@corena.no (Bjorn Brox)
Message-Id: <9906210553.AA17900@senja.corena.no>
Subject: Re: Controlling Rational Values
To: tiff@olympiakos.com (TIFF Mailing List)
Date: Mon, 21 Jun 1999 07:53:40 +0200 (CETdst)
Cc: ritter@earthlink.net (Niles Ritter)
In-Reply-To: <376D5AD9.6F4FD346@earthlink.net> from "Niles Ritter" at Jun 20, 99 09:19:21 pm
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Sender: owner-tiff@olympiakos.com

Niles Ritter wrote this:
> 
...
Explicitly setting the denominator to some value sounds like a bad idea;
what yo u really want is the "best" representation, which for anything
sufficiently close to an integer gives (x,1).
...
> To do this you create what's called a continued-fraction expansion
...
> for such rubbish. There is a reason the tag was called rational, after all...
> 
Why make it so complex?

I have never seen x/y resolution defined with decimals.

Therefore: storing 200.0 as something else than 200/1 seems stupid, and makes
it more difficult to "debug" tiff files.

I would add this simple test to TIFFWriteRationalArray()

    if (fv == (float)((int)fv)) {
	t[2*i+0] = (int)fv;
	t[2*i+1] = 1L;
    } else {
	...
    }
and ask Niles Ritter to improve the complex method of writing a rational.

-- 
Bjorn Brox, CORENA Norge AS, http://www.corena.no/
Kirkegaardsvn. 45, P.O.Box 1024, N-3601 Kongsberg, NORWAY
Phone: +47 32737435, Fax: +47 32736877, Mobile: +47 92638590
