Mail Archives: geda-user/2015/09/14/16:43:53
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 -