
On 6/8/05, Allen <yaozhen@ustc.edu> wrote:
I wonder how this can be implemented. How could you separate the decimal part and the exponent part from the double literal like 3.14159
Would you upload the code to boost-sandbox vault?:)
Have done: http://boost-sandbox.sourceforge.net/vault/ meta_double.hpp
Peder Holt wrote:
Is there any interest in a compile-time meta-version of double?
Syntax:
//Definition typedef META_DOUBLE(3.1415926535897932384626433) pi; //Or META_DOUBLE(3.1415926535897932384626433) pi_;
//Mathematical operations typedef math::meta::add<pi,pi>::type pi2;
//Evaluation: assert(META_DOUBLE_EVAL(pi2)==3.1415926535897932384626433*2);
This implementation uses two ints to represent the decimals, and a short to represent the exponent.
It has been tested on VC7.1,VC8.0 beta and GCC3.2
Regards, Peder
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost