Bugs item #1826937, was opened at 2007-11-06 07:49
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112740&aid=1826937&group_id=12740Please 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: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
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,
[hidden email]
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112740&aid=1826937&group_id=12740-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>
http://get.splunk.com/_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev