
On 4/19/2013 7:15 PM, Vicente J. Botet Escriba wrote:
Le 18/04/13 15:39, Dmitriy Gorbel a écrit :
I want to provide my proposal to the Boost community.
Please, lets discuss it! I will be grateful for your reviews and advices. How can I improve it? I appreciate any feedback you may have.
proposal_Dmitriy_Gorbel.pdf <http://boost.2283326.n4.nabble.com/file/n4645577/proposal_Dmitriy_Gorbel.pdf>
<snip very good feedback>
There is a typo: The range must be *grater* then the resolution I don't understand your types. cardinal<16> 0 <= n <= 65536 This seems to be a 16 bit unsigned type but requires 17 bits to store this range. It should probably be 0 <= n <= 65535. integral<4> -16 <= n <= 16 Similar here this seem to be a 5 it signed integer but requires 6 bits to store this range. It should probably be -16 <= n <= 15. nonnegative<8,-4> -256 < n < 256 in increments of 2^-4 = 1/16 I don't understand how a type nonnegative can store values in (-256,0). negatable<16,-8> -65536 < n < 65536 in increments of 2^-8 = 1/ 256 This seems close to a fixed point type as I'm used to seeing it. Although again the ranges seem wrong. I'm much more accustom to seeing fixed point number specified as <Magnitude bits, Fractional Bits> i.e. <16,8> instead of <16,-8>. Still this representation makes sense because it specifies both parameters in terms 2^x. It also supports something like <17,1> to give a 16 bit type that has the range [-131072, 131071] in increments of 2. Still it might be surprising to those familiar with the more common fixed-point notation.