|
From: SourceForge.net <no...@so...> - 2007-11-07 11:39:14
|
Bugs item #1826937, was opened at 2007-11-06 16:49 Message generated for change (Comment added) made by lballabio You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=1826937&group_id=12740 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) >Assigned to: Luigi Ballabio (lballabio) Summary: < operator in Period class incorrect Initial Comment: The following code incorrectly throws an "undecidable" comparison. // Demonstrates false undecidability in Period. #include <iostream> #include <ql/quantlib.hpp> using namespace std; using namespace QuantLib; int main (int argc, char * const argv[]) { Period p3m(3, Months), p1w(1, Weeks); cout<<"Hello, World! " << p3m << ", " << p1w << endl; bool bigGTsmall = p3m > p1w; cout << "bigGTsmall = " << bigGTsmall << endl; // next comparison throws "undecidable comparison" bool bigLTsmall = p3m < p1w; cout << "bigLTsmall " << bigLTsmall << endl; return 0; } I've attached a possible fix, coded for clarity. (The original comparison code in the Period class has a significant number of nested ifs and switches). Best, Chr...@ya... ---------------------------------------------------------------------- Comment By: Luigi Ballabio (lballabio) Date: 2007-11-07 12:39 Message: Logged In: YES user_id=75450 Originator: NO The bug is now fixed in CVS. Thank you for the report. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=1826937&group_id=12740 |