Login  Register

Re: money comparison

Posted by Luigi Ballabio on Sep 06, 2011; 11:01am
URL: http://quantlib.414.s1.nabble.com/money-comparison-tp11964p11968.html

On Mon, 2011-09-05 at 09:31 -0600, Matt Fair wrote:
> Luigi,
> I understand that you can call close_enough manually if you need to,
> but from an object oriented standpoint it doesn't make sense.  Is
> there a reason why you have both?

It was to have the same behavior as doubles, but I see your point.
That's an implementation detail, not the behavior expected in the domain
(actually, Money shouldn't use a floating-point number at all---we
should store an integer number of cents---but that's for another time.)
I wonder if one should go all the way and compare after rounding?

Thoughts?

Luigi


--

Better to have an approximate answer to the right question than a
precise answer to the wrong question.
-- John Tukey as quoted by John Chambers



------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev