<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 8, 2014 at 4:12 PM, Roman Cheplyaka <span dir="ltr"><<a href="mailto:roma@ro-che.info" target="_blank">roma@ro-che.info</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">So it is fixed, too? I'm not sure "Fixed" qualifies as a key word, then :)<br>

<br>
Note that Data.Fixed doesn't put any restrictions on the (fixed)<br>
precision. You could easily define E34.<br></blockquote><div><br></div><div>No, it is not fixed.</div><div><br></div><div>>>> digits . unDeka . fromJust . strToDeka $ "3.00"</div><div>3</div><div><br></div>
<div><div>>>> digits . unDeka . fromJust . strToDeka $ "3.0000"</div><div>5</div></div><div><br></div><div>The precision is determined at runtime.  In contrast, with Data.Fixed, the programmer sets the precision at compile time.  There is no difference between</div>
<div><br></div><div>>>> 3 :: Fixed E6</div><div><br></div><div>and</div><div><br></div><div>>>> 3.00 :: Fixed E6</div><div><br></div><div>These issues are discussed at</div><div><br></div><div><a href="http://speleotrove.com/decimal/decifaq1.html#tzeros">http://speleotrove.com/decimal/decifaq1.html#tzeros</a><br>
</div><div><br></div><div>but if your reaction is "so what, it's just some extra zeroes and at compile time I can just use E34", then by all means, keep using Fixed :)</div><div><br></div><div>Also, note that you get 34 significant digits, but that doesn't mean the exponent is limited to 34.</div>
<div><br></div><div>>>> let x = fromJust . strToDeka $ "3E-200"</div><div>>>> let y = fromJust . strToDeka $ "4E-200"</div><div>>>> x + y</div><div>Deka {unDeka = 7E-200}<br>
</div><div><br></div><div>...which you could do in Fixed, true.  If you defined E200 first.  But, oops, now I need E250...</div><div><br></div><div>Really this is a binding to decNumber, which implements the General Decimal Arithmetic Specification, so see if decNumber and that specification scratch an itch.  If they don't, use Fixed, or Decimal (also on Hackage) or something else...</div>
<div><br></div></div></div></div>