[vtkusers] doubles, floats, java
Karin Faulhaber
faulhaber at ipf.uni-karlsruhe.de
Thu Jun 28 10:29:43 EDT 2001
Hi Jeff,
thanks for the quick answer.
> a) The precision provided is better than what you need. Take
> what java gives you and round
> and/or format before displaying, printing, or otherwise
> presenting it to humans.
>
> b) The precision provided is not as good as you need. If
> you're using Java, you can use
> BigDecimal to get arbitrary precision at the cost of
> performance.
>
> Solution a is sufficient for most, since a Java double provides
> something like 16 digits of precision. I forget the
> formal definition, but it's something like "The absolute value of the
> error will be less than 5 * 10^-17 *
> actual result".
16 digits should be more then enough for my needs, but my numbers _are_
rounded, so I went for solution b. The problem is, even if I use
BigDecimal I have to cast it to get it into vtkDoubleArray, which gives
me the same wrong/rounded numbers as before as result of GetComponent().
Any ideas for that?
Karin
--
Karin Faulhaber
Universitaet Karlsruhe
Institut fuer Photogrammetrie und Fernerkundung (IPF)
Englerstr. 7
76128 Karlsruhe
Tel: 0721/608-3676
E-Mail: faulhaber at ipf.uni-karlsruhe.de
More information about the vtkusers
mailing list