[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: pcb crooked traces



Andrew Poelstra:
> On Fri, Oct 08, 2010 at 11:04:59PM +0200, Karl Hammar wrote:
> > 
> > Please, I was commenting about the misunderstandings about
> > "floating-point", not about mils and mm's.
> > 
> > With integer types you get aliasing artifacts, which actually is a 
> > rounding error. We have this problem in the current incarnation of pcb.
> > 
> > So, in what way are floats worse than ints (I'm talking about 
> > representaion, not about performance) and why could we not "reasonably 
> > use floating-point"?
> >
> 
> The concern is with /binary/ floating point, not floating point
> in general. In binary floating point, your scale is always a power
> of 2, so some numbers cannot be represented - particularly, some
> numbers cannot be represented that /can/ be represented in decimal
> (like 0.3), so we will introduce an error when somebody types .3
> into pcb. With integers, anything the user can type, can be represented.

It seems that you don't see what you write.

Try this:

 double fx = 0.3;
 int    ix = 0.3; // or int64_t if you like

which one of theese two differs most from 0.3 ?

> Importantly, 1/254 = 1/2 * 1/127 cannot be represented in
> binary floating point, which brings us back to the mm/mil
> problem.

Yes, but that is a different problem. Having int's is not better than 
floats for that, and having floats does not solve that either.

> This is the crucial difference between our scaling idea
> (fundamental units + an arbitrary multiplier) and binary
> floating point.

What we need is that "1" == "1 nm", and that can be implemented with
integers OR floats.

**

You cannot dissmiss floating point on the ground of rounding error
when in fact the rounding error of integers (aliasing, truncation)
are in fact greater.

You cannot dissmiss floating point on the ground of a "non exact"
equality operator, boot integers and floats, when 1 == 1nm, suffers
from beeing too fine grained. You will not see any difference for
+/- 100 basic units when looking at the board, even with a microscope.

Regards,
/Karl Hammar

---------
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57




_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user