- When mathematicians/engineers say interval they usually mean (continuous) subsets of ℂ or at least ℝ. This unit works for with ordinal data types only. Hence it’s essentially a “big set” unit that economizes on space provided large continuous chunks are member of it. For Alpine’s application this is ideal, but it addresses a fairly specific problem.
Besides the immediate problem that I have, I decided to implement such a unit to be able to address another set of tasks I have mentioned also - the timing intervals (or spans).
In my daily work, and I believe in many other peoples work as well, I need to handle (split, intersect, etc.) a time span again a set of predefined schedules, e.g. to split somebody's stay at some premises to work-time, overtime, weekend time, etc. Similar is to check if one have an access to a resource in a daily, weekly, or monthly basis, or to calculate a fee based on a tiered prices.
That way, specializing those generics with unix times (Int64) will give a convenient instrumentation for the job. I have already implemented similar templates in C++. Now I'm writing the FPC library with the same purpose in mind. That is a true intervals (or time spans) and in a no way another "big-set" implementation.
- When I say interval arithmetic I understand arithmetic operations are performed with an external rounding mode, i. e. the operation uses round toward +∞ for the upper bound, round toward −∞ for the lower bound.
I should note that I have a pretty strong mathematical background and I'll admit those have nothing to do with the "intervals" in the common mathematical sense, but OTOH, the "arithmetic" is definable on an any properly defined structure as long the operations obey the needed properties. But since it will be best if the identifiers were obvious for everybody - I am eagerly accepting suggestions for renaming.
- The source code is a little light on source code comments. (This is acceptable during the development phase.)
Of course it should have a proper comments together with some documentation article. But first it needs to get its proper shape.
Thanks for the input,