
I also do some static assertions and I was thinking of adding static functionality to add, multiply, divide, etc. at compile time. One could do this if one knew the lhs & rhs values at compile-time.
What's the "typename DT" template parameter for?
RT = range type, and DT = data type. That's what I meant by "sort of" for the floats. When I was able to do my math with ints it worked great but when I had to switch to doubles that's the closest I got. Bounding the floating point value against integral limits.
Let me clean up what I've got and I'll send it to you via email with a small test program and we can kick it around a while.
O.K. I'll clean mine up too. I also want to look at what Cromwell & Peder are working on. I really like the idea of performing as much of the math as possible at compile time. There-in lies part of the tricky bit though, if it can't be resolved at compile time it needs to revert to a run-time operation. Matt Scanned by Fortigate {X3BTB534}