[Haskell-beginners] High precision doubles

Sean Bartell wingedtachikoma at gmail.com
Wed Jun 24 22:14:19 EDT 2009


>
> When adding a new node/hex to the graph/maze, I pick an existing node and
> get all of its neighbour co-ordinates, filtering out co-ordinates that
> represent nodes already present in the graph. The problem is that, due to
> floating point errors, these co-ordinates are not be exact. If hex A has the
> co-ordinate for hex B in its list of adjacent hexes, hex B would not
> necessarily have the co-ordinate for hex A in its own list. Things get
> mismatched quickly.


You won't be able to get it working easily with floating-point numbers.
Ideally, you would use integers for the code you're describing, then scale
them to the proper floating-point values later.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20090624/f275bdb5/attachment.html


More information about the Beginners mailing list