XIRR Error State



I've modified the gnumeric_xirr function to support the following interface:

xirr( double* values, double* dates, int n );

(Rather than populating the 'p' variable's members with calls to 'collect_floats_value' in the gnumeric_xirr routine, I simply pass 'values' and 'dates' as parameters)

The trouble I'm having is:

double values[5];
values[0] = -1000.0;
values[1] = 300.0;
values[2] = 300.0;
values[3] = 300.0;
values[4] = 300.0;

double dates[5];
dates[0] = 36500.0;
dates[1] = 36600.0;
dates[2] = 36700.0;
dates[3] = 36800.0;
dates[4] = 36900.0;

printf( "XIRR: %f\n", xirr( values, dates, 5 ) );

This is returning an error state. Every input I have tried returns an error state. My guess is I'm not giving input correctly.

Any suggestions?

Any help is greatly appreciated.

-Daniel Bigham
519-539-6856

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]