Ian wrote:
> wrote:
> > I am writing a program to calculate prices of commodity options as part
> > of my Masters degree in Finance. (Absolutely no prior knowledge of
> > computer programming was assumed.)
> >
> > I am representing dates as integers. It's important to be able to
> > derive the month from the date so I have programmed this using mod 365
> > arithmetic.
>
> And leap years?
>
> How about looking up the date/time API for your platform? Doing so
> could save you a lot of unnecessary work.
hence locking your program to a particular platform. There is the
venerable
time.h (or as its spelled in C++ ctime). It's a little clunky but it
could be
wrapped up in a class to make it a little friendlier. There is also a
boost
library that handles time see
www.boost.org
--
Nick Keighley