Ada to C++ conversion of floating types filter
November 26, 2007 7:05 PM Subscribe
I am currently working on a by the book Ada to C++ conversion of legacy code and am having a bit of trouble coming with a C++ solution for a particular Ada idiom.
posted by caflores22 to Computers & Internet (7 answers total) 2 users marked this as a favorite
The Ada construct specifies floats with various levels of precision and then uses these types in bit packed fields:
Delta15: constant := (1.0 / 2**15)
type Data16 is delta Delta15 range -1.0 .. (1.0 - Delta15);
for Data16 'Size use 16;
type X is
My question is this, how do I represent this in C++? Double's and floats are 64 bits by default. Essentially I need to create a 16 bit fixed point double. Any ideas are welcome. Thanks for your help.