Talk:REAL 64 (issues)
--Juliant 22:18, 27 November 2006 (CET)
To solve the problem with 'three_way_comparison' I would suggest to just return '-2' on cases where NaN is involved. This way COMPARABLE stays clean of such things as 'is_special_case' which will only lead to confusion of users of the class. This problem also occurs only on reals since all other uses of COMPARABLE (characters, strings, integers and probably most user defined sublcasses) don't have that problem.
Also this would add a second 'is_special_case' to REAL_64 since now it alredy inherited one from NUMERIC. And note that NUMERIC.is_special_case and COMPARABLE.is_special_case would be two different ones since in the numeric case NaN and infinity are special and in the comparable case only NaN is considered special.
--Colin-adams 10:39, 10 May 2007 (CEST) I can see difficulties with -2.
Firstly, the name of the routine. Secondly, there might be a lot of existing code that is broken as a result of the change. Well, this code is probably broken in the face of NaNs anyway.
I would be happier with introducing a routine `is_comparable' into COMPARABLE. Yes, I know this sounds a little crazy. But it is a fact of life that NaNs aren't comparable.