Oh boy I know there's different kinds of math but not different kinds of
arithmetic. If you mentioned recursive functions to me I would think of 1..
f(x) 2. a function that calls itself. But that's just about it.
Thanks Mich.
- Show quoted text -
As re #3: whats 20000+30000? Using 16-bit signed arithmetic, the
answer is either "It's illegal" or "-17232" (not 50000).
What's 19/5? Using integer arithmetic, the answer is "4" (not 4.8).
As re #2? What is the most appropriate representation of a date? Well,
that depends upon whether you are going mostly to be just displaying
it or whehter you are going to be sorting with it or whether you might
want to caluculate with it.
If you are mostly just displaying the date, then whatever format
people who are using the program prefer to see the date is most
appropriate. "Friday, February Tenth Twenty-Eleven" would be just
fine, if your people like to see the date that way.
If however, you want to sort by it so that later dates occur before or
after earlier ones, depending, then you want to do something like
"20110210" (adding hyphens or slashes is OK, provided you always
include the zeros or use a leading space for mothns or days less than
10). You could have three different fields for year, month, and day in
that order, if you want.
If, in the third case, you might want to be able to calculate the
differences between the dates, you should either use the Julian Date
(number of days since the calendrical convergence) or take the number
of seconds since 1970 (or other convenient date) and either use it or
divide it by 86400.
In the last case, you have to use or find a function that shows the
dates for human consumption in a meaningful format and one that allows
input from humans in a convenient format (A date picker gadget?)
As re #1 (sorry for the typo), you need to understand how memory
storage is organized so that when you aggregate the data into a struct
and attempt to persist it, you will know what you are getting, so that
you can interpret the data that you retrieve from a persistent store
in the same way that you meant it when you persisted it.