function testTBillYield() { // various random calculations $this->assertTrue(abs(0.091417 - Math_Finance::TBillYield(mktime(0, 0, 0, 3, 31, 2008), mktime(0, 0, 0, 6, 1, 2008), 98.45)) < FINANCE_PRECISION); // settlement must be before maturity $this->assertType('object', Math_Finance::TBillYield(mktime(0, 0, 0, 6, 1, 2008), mktime(0, 0, 0, 3, 31, 2008), 98.45)); // maturity can't be more than one year after settlement $this->assertType('object', Math_Finance::TBillYield(mktime(0, 0, 0, 6, 1, 2008), mktime(0, 0, 0, 3, 31, 2010), 98.45)); }