It&#39;s well-known that floats can&#39;t be treated the same way as integers... but since PD is aimed at non-engineers and non-scientists I think it would be a good idea to implement the &quot;good&quot; comparison algorithms (i.e. checking against a threshold, etc) inside [==] and so, just to make patching easier. Maybe it&#39;s already supposed to behave this way...<br>
<br> As for the loss of integer precision issue, an object that detects &quot;integer overflow&quot; (that is, when all integer digits of the number cannot be represented) could be created, taking into account the floating point precision (32-bit, 64-bit...) and so.<br>
<br><div class="gmail_quote">2012/3/9 Mathieu Bouchard <span dir="ltr">&lt;<a href="mailto:matju@artengine.ca">matju@artengine.ca</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Le 2012-03-09 à 09:39:00, Charles Henry a écrit :<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Martin a écrit :<div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
For any floatX unless X is infinity the number of floats that are not<br>
exactly represented is always infinite.<br>
</blockquote></div></blockquote>
<br>
For a floatX format where X is the number of bits, every float is exact and there are at most pow(2,X) floats.<br>
<br>
You mean that there are an infinity of numbers that round to a finite number of floats.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
There is a countably infinite number of rational numbers and a uncountably infinite number of irrational numbers that cannot be represented.<br>
</blockquote>
<br></div>