www.delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2015/09/14/16:43:53

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
X-TCPREMOTEIP: 207.224.51.38
X-Authenticated-UID: jpd AT noqsi DOT com
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
Subject: Re: [geda-user] Apollon
From: John Doty <jpd AT noqsi DOT com>
In-Reply-To: <20150914175929.22829.qmail@stuge.se>
Date: Mon, 14 Sep 2015 14:43:27 -0600
Message-Id: <074A28AA-547E-4B71-8D81-30D2CB1B74F3@noqsi.com>
References: <20150913140631 DOT 1da1b78d AT jive DOT levalinux DOT org> <201509131529 DOT t8DFTUVS022118 AT envy DOT delorie DOT com> <20150914175929 DOT 22829 DOT qmail AT stuge DOT se>
To: geda-user AT delorie DOT com
X-Mailer: Apple Mail (2.1878.6)
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id t8EKhXVk022935
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sep 14, 2015, at 11:59 AM, Peter Stuge (peter AT stuge DOT se) [via geda-user AT delorie DOT com] <geda-user AT delorie DOT com> wrote:

> DJ Delorie wrote:
>> "Angular data is stored in signed integer,"
>> 
>> Not floating point?
> 
> I disagree very strongly with floating point, but using a fixed-size
> decimal is an important improvement!

The trouble is that common computer numerics do not actually obey the same rules as mathematical numbers.

In floating point, you may not assume (a+b)+c==a+(b+c).

In fixed point this is OK, as long as overflow is modular. But in fixed point, you may still not assume that (a/b)*b==a (floating point does this more accurately, but not perfectly).

Rational numbers fix these problems. (a+b)+c==a+(b+c), and (a/b)*b==a, always. Technically, the rationals are closed under addition, subtraction, multiplication, and division. Fixed and floating point numbers are not.

As for speed, rational computation is indeed slower than floating point, typically about 30x for matrix arithmetic in Mathematica. Smart design might use rationals to keep track of reference points for the purpose of rigorously determining what touches or overlaps with what. For rendering on a grid, use fixed or floating point. The rationals that fall on your grid are a set of measure zero, anyway.

> 
> 
>> Given location is nanometers, you should have an equally precise
>> unit for other measurements.
> 
> Yes! And floating point isn't always so precise.
> 
> 
> //Peter
> 

John Doty              Noqsi Aerospace, Ltd.
http://www.noqsi.com/
jpd AT noqsi DOT com



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019