Commit 2e023f83 authored by Jukka-Pekka Iivonen's avatar Jukka-Pekka Iivonen Committed by jpekka

Fixed frequency 2 and 4. Now it can pass quite extensive test suite.

2001-10-03  Jukka-Pekka Iivonen  <jiivonen@hutcs.cs.hut.fi>

        * src/functions/fn-financial.c (coupnum): Fixed frequency 2 and 4.
        Now it can pass quite extensive test suite.
parent d9fbb2fe
2001-10-03 Jukka-Pekka Iivonen <jiivonen@hutcs.cs.hut.fi>
* src/functions/fn-financial.c (coupnum): Fixed frequency 2 and 4.
Now it can pass quite extensive test suite.
2001-10-03 Jody Goldberg <jgoldberg@home.com>
* src/item-cursor.c (item_cursor_point) : disable events that could
......
......@@ -39,6 +39,7 @@ Jody:
the number of problems with gnome-print installs.
Jukka:
* Fixed COUPNUM().
* MPS importer plugin implemented. Reads a linear program in MPS
format and creates a spreadsheet model of it. Currently, the
bounds and ranges are not implemented yet.
......
2001-10-03 Jukka-Pekka Iivonen <jiivonen@hutcs.cs.hut.fi>
* src/functions/fn-financial.c (coupnum): Fixed frequency 2 and 4.
Now it can pass quite extensive test suite.
2001-10-03 Jody Goldberg <jgoldberg@home.com>
* src/item-cursor.c (item_cursor_point) : disable events that could
......
2001-10-03 Jukka-Pekka Iivonen <jiivonen@hutcs.cs.hut.fi>
* src/functions/fn-financial.c (coupnum): Fixed frequency 2 and 4.
Now it can pass quite extensive test suite.
2001-10-03 Jody Goldberg <jgoldberg@home.com>
* src/item-cursor.c (item_cursor_point) : disable events that could
......
2001-10-03 Jukka-Pekka Iivonen <jiivonen@hutcs.cs.hut.fi>
* src/functions/fn-financial.c (coupnum): Fixed frequency 2 and 4.
Now it can pass quite extensive test suite.
2001-10-03 Jody Goldberg <jgoldberg@home.com>
* src/item-cursor.c (item_cursor_point) : disable events that could
......
......@@ -426,16 +426,16 @@ coupnum(GDate *settlement, GDate *maturity, int freq, int basis)
return years*2
+ (months > 6) + (months == 6 && days > 0)
+ (months > 0) + (months == 0 && days > 0)
- (months < -6) - (months == -6 && days < 0);
- (months < -6) - (months == -6 && days <= 0);
else
return years*4
+ (months > 9) + (months == 9 && days > 0)
+ (months > 6) + (months == 6 && days > 0)
+ (months > 3) + (months == 3 && days > 0)
+ (months > 0) + (months == 0 && days > 0)
- (months < -3) - (months == -3 && days < 0)
- (months < -6) - (months == -6 && days < 0)
- (months < -9) - (months == -9 && days < 0);
- (months < -3) - (months == -3 && days <= 0)
- (months < -6) - (months == -6 && days <= 0)
- (months < -9) - (months == -9 && days <= 0);
}
static GDate *
......
......@@ -426,16 +426,16 @@ coupnum(GDate *settlement, GDate *maturity, int freq, int basis)
return years*2
+ (months > 6) + (months == 6 && days > 0)
+ (months > 0) + (months == 0 && days > 0)
- (months < -6) - (months == -6 && days < 0);
- (months < -6) - (months == -6 && days <= 0);
else
return years*4
+ (months > 9) + (months == 9 && days > 0)
+ (months > 6) + (months == 6 && days > 0)
+ (months > 3) + (months == 3 && days > 0)
+ (months > 0) + (months == 0 && days > 0)
- (months < -3) - (months == -3 && days < 0)
- (months < -6) - (months == -6 && days < 0)
- (months < -9) - (months == -9 && days < 0);
- (months < -3) - (months == -3 && days <= 0)
- (months < -6) - (months == -6 && days <= 0)
- (months < -9) - (months == -9 && days <= 0);
}
static GDate *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment