Java Ugly Rounding Error?

Posted by billynomates on Stack Overflow See other posts from Stack Overflow or by billynomates
Published on 2010-03-28T15:53:42Z Indexed on 2010/03/28 17:43 UTC
Read the original article Hit count: 241

Filed under:
|
|
|

Using series.add(180, 1); produces a perfectly valid chart like this (little red dot at the bottom with some PolarItemRenderer Mods!)

alt text

but using series.add(3000/(6000/360), 1); produces this beast:

alt text

I assume it's because somewhere, 6000/360 = 16.6... is getting rounded? How can I stop this happening? Thanks :)

© Stack Overflow or respective owner

Related posts about jfreechart

Related posts about rounding