<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jun 22, 2014 at 1:48 AM, James Courtier-Dutton <span dir="ltr"><<a href="mailto:james.dutton@gmail.com" target="_blank">james.dutton@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="">On 21 June 2014 00:40, Sean Silva <<a href="mailto:chisophugis@gmail.com">chisophugis@gmail.com</a>> wrote:<br>
><br>
><br>
> my 2c: describe it as "an approximate, high-dynamic-range unsigned integer".<br>
><br>
> That doesn't lend itself to something easy to type, but "ApproxHDRUint"<br>
> might be doable. Plus, it sounds sort of scary.<br>
><br>
> Having something in the name that suggests that it is an integer should ward<br>
> off any attempt to use it for numerics.<br>
><br>
> -- Sean Silva<br>
><br>
<br>
</div>I would suggest that "high-dynamic-range" is also the wrong word. It<br>
is not actually providing any extra dynamic range.<br></blockquote><div><br></div><div>Dynamic range is the ratio between the largest and smallest representable value (see <a href="http://en.wikipedia.org/wiki/Dynamic_range">http://en.wikipedia.org/wiki/Dynamic_range</a>). So yes it does provide more dynamic range; in fact, pretty much the entire purpose of using floating point numbers is to extend the dynamic range (see <a href="http://en.wikipedia.org/wiki/Floating_point">http://en.wikipedia.org/wiki/Floating_point</a>).<br>
<br>What changes is the distribution of the numbers; they are no longer uniformly distributed (see Knuth 4.2.4 "Distribution of Floating Point Numbers" or google for "distribution of floating point numbers").<br>
<br></div><div>-- Sean Silva<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Having something that can go from 0 to 20 in steps of 2 has no better<br>
dynamic range as something that can go from 0 to 10 in steps of 1.<br>
Simply calling it "scaled unsigned integer" is more accurate.<br>
Or "unsigned integer with scale factor".<br>
<br>
I think it would also be a good idea to explain what maths operations<br>
you are likely to want to do.<br>
For example, if the number is 20, with scale factor 2, and you add 1<br>
with scale factor 1 to it, the answer is undefined.<br>
If all you are going to do is somehow reach a value and then is won't<br>
change, and the only operations you are going to do are "compare"<br>
operations, then that is something that is easier to understand for<br>
other programmers.<br>
<br>
Just out of curiosity, what is the requirement or use case that is<br>
driving a "scaled unsigned integer" instead of say just using an<br>
integer with more bits.<br>
<span class=""><font color="#888888"><br>
James<br>
</font></span></blockquote></div><br></div></div>