Path: csiph.com!aioe.org!.POSTED!not-for-mail From: =?UTF-8?Q?Arne_Vajh=c3=b8j?= Newsgroups: comp.lang.java.programmer Subject: Re: double == double Date: Sun, 16 Oct 2016 09:45:35 -0400 Organization: Aioe.org NNTP Server Lines: 24 Message-ID: References: <8737k0qd38.fsf@golem.phantasia.org> <87zim5es30.fsf@golem.phantasia.org> NNTP-Posting-Host: PBuS014lhzVyHjLbXmo/ZQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.programmer:35783 On 10/15/2016 10:16 PM, 4ndre4 wrote: > On 16/10/2016 01:30, Arne Vajhøj wrote: > [...] >> = is fine for String. But < <= > >= can be problematic: > > I know well, but - as said in my previous post - I am assuming that the > comparator would parse the version and carry out a correct comparison on > its single parts. Similarly to having a sstring representing a date. > It's not that strings are problematic to represent strings; you have to > parse those strings correctly. Yes. But that model is really using a dedicated class to represent the item and all comparisons should be done on instances of that class and String is just an external representation used outside of Java. Arne