[concurrency-interest] Double as a key in TreeMap

Stanimir Simeonoff stanimir at riflexo.com
Thu May 31 16:27:47 EDT 2012


George,

You can always employ your own Comparator and compare the Doubles the way
you see fit (i.e. w/ some rounding). Thus, you can have full control.

On Thu, May 31, 2012 at 11:16 PM, George Kovoor <mydevgroup at gmail.com>wrote:

> Unfortunately there is no such group,
>
> On Thu, May 31, 2012 at 9:07 PM, Pavel Rappo <pavel.rappo at gmail.com>
> wrote:
> > Hi George,
> >
> > how about you try to write to the double-interest at cs.oswego.edu mailing
> list?
> >
> > On 31 May 2012, at 21:01, George Kovoor wrote:
> >
> >> Hello,
> >> Could anyone please advise if using Double as a key in TreeMap is
> >> safe, safe in the sense will it result in consistent output.
> >> I am worried about the floating point precision, that might result in
> >> key misses , is my understanding correct. Is using Double recommend in
> >> Java
> >>
> >> Any feedback is very much appreciated
> >>
> >> Thanks
> >> George
> >> _______________________________________________
> >> Concurrency-interest mailing list
> >> Concurrency-interest at cs.oswego.edu
> >> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
> >
> > _______________________________________________
> > Concurrency-interest mailing list
> > Concurrency-interest at cs.oswego.edu
> > http://cs.oswego.edu/mailman/listinfo/concurrency-interest
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20120531/e32448a8/attachment-0001.html>


More information about the Concurrency-interest mailing list