
Eh? So what you want is essentially (denormal) floating-point, except that the exponent is specified at compile time? That's interesting. I haven't had a need for higher range than precision, so it was never a problem for me to include bits all the way down to 2^0. Matt ________________________________ From: boost-bounces@lists.boost.org on behalf of Ravi Sent: Thu 3/17/2011 1:28 AM To: boost@lists.boost.org Subject: Re: [boost] [boostcon][proto] Suggestion for LIAW session:fixed-pointnumbers On Wednesday 16 March 2011 19:24:31 Gruenke, Matt wrote:
In the system you proposed, what are the template parameters for the fixed- point number with the following range?
{ 0, 1, ..., 15 } x 2^{-11}
11 fractional bits.
Or, the fixed-point number holding values in the following range?
{ 0, 1, ..., 15 } x 2^{11}
15 integer bits.
Suboptimal at best, and usually unacceptable because it leads to overflow of the underlying type (int64, for example) much sooner than necessary in complex expressions. The way it is usually avoided is to specify (in your notation) the examples above as -7.11 and 15.-11, which, while consistent, is completely unintuitive and unobvious. Regards, Ravi _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost