[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Best way to represent fractional values?

  • To: xml-dev@l...
  • Subject: Re: Best way to represent fractional values?
  • From: John Cowan <cowan@m...>
  • Date: Mon, 10 Feb 2003 14:25:25 -0500 (EST)

Re:  Best way to represent fractional values?
Hugh Wallis scripsit:

> But my point is that I can never make fractionDigits large enough to reach a
> representation of 1/3 since that would require fractionDigits to equal
> infinity. I want to be able to represent exactly 1/3, not some close
> approximation of it.
> 
> Now I know people are going to say "you can't do that in computers because
> of floating point stuff" but that isn't really true - if you represent the
> numerator and denominator separately then you can represent it perfectly
> fine.

Indeed, the Lisp/Scheme family of languages do as a rule implement exact
rational numbers as fractions:  (/ 1 3) evaluates to 1/3.

-- 
Higgledy-piggledy / XML programmers     John Cowan
Try to escape those / I-eighteen-N woes;        http://www.ccil.org/~cowan
Incontrovertibly / What we need more of is      http://www.reutershealth.com
Unicode weenies and / Fran\xe7ois Yergeaus.        jcowan@r...

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.