<div dir="ltr">Yeah, SC is double float, but they seem to round it up for some reason, maybe the same reason as Pd. But SC uses single float for signal processing, so it is the same as Pd in the end.<div><br></div><div>Well, I did believe that Pd compiled for 64bits did increase the resolution to double, but ok, it does not. And yeah, it just means it's compiled for a 64 bit OS... But what does it mean in practical terms? What is the advantage?</div><div><br></div><div>Seems Pd runs faster if compiled to 64 bits in a 64 bit OS than if it were compiled as 32, which does makes sense. That's all?</div><div><br></div><div>Now, if it were to run as double precision, then it'd clearly run slower, right?</div><div><br></div><div>I don't have much deep knowledge in this, I appreciatte if anyone cares to share their wisdom.</div><div><br></div><div>thanks</div><div>Alex</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-01-31 18:23 GMT-02:00 Martin Peach <span dir="ltr"><<a href="mailto:chakekatzil@gmail.com" target="_blank">chakekatzil@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I tried this using c on Windows:<br><br>float:<br>Pi is 3.14159274101257320000000000000<br>double:<br>Pi is 3.14159265358979310000000000000<br><div>, which matches the supercollider value:<br>       3.1415926535898<br></div><div><br>My lpi.pd_lua also gives 3.141592653589793100 on WIndows but on linux I got 48 digits after the decimal:<br>3.1415926535897931159979634685441851615905761718750000<br><br></div>And from <a href="http://www.piday.org/million/" target="_blank">http://www.piday.org/million/</a> the first 54 digits of pi are these:<br><div class="gmail_extra"><br>3.14159265358979323846264338327950288419716939937510582<br><br></div><div class="gmail_extra">So a float is accurate to 6 decimal places, a double is accurate to 15, and supercollider rounds the double to 13.<br></div><div class="gmail_extra">Lua on linux gives 48 digits but it's also only accurate to 15.<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888"><div class="gmail_extra">Martin<br><br></div></font></span><div><div class="h5"><div class="gmail_extra"><div class="gmail_quote">On Sat, Jan 31, 2015 at 1:46 AM, Alexandre Torres Porres <span dir="ltr"><<a href="mailto:porres@gmail.com" target="_blank">porres@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 dir="ltr"><div>So, cant we raise the bit resolution of pd to more than what's there? how?<br></div><div><br></div><div>Martin, about the pi in lua, i never got to see it, but supercollider prints the value of pi as </div><div><br></div><div>3.1415926535898<br></div><div><br></div><div>so thats more than 24 bit float, but what is it?</div><div><br></div><div>cheers</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-01-29 15:47 GMT-02:00 Martin Peach <span dir="ltr"><<a href="mailto:chakekatzil@gmail.com" target="_blank">chakekatzil@gmail.com</a>></span>:<div><div><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Here's a patch using pdlua that shows the value of pi in various ways. I get 48 decimal places in a symbol.<span><font color="#888888"><br><br></font></span></div><span><font color="#888888">Martin<br></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 29, 2015 at 12:36 PM, Alexandre Torres Porres <span dir="ltr"><<a href="mailto:porres@gmail.com" target="_blank">porres@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 dir="ltr"><span>> <span style="font-size:12.8px">more that 7 digit but less than 8 digits</span><br style="font-size:12.8px"></span>...<span><br style="font-size:12.8px"><span style="font-size:12.8px">> so, 4/3 =! 1.33333 </span><div><span style="font-size:12.8px">> but 4/3 == 1.33333333 (8 "3")</span></div><div><span style="font-size:12.8px"><br></span></div></span><div><span style="font-size:12.8px">I don't get it. More than 7 decimal digits but less than </span><span style="font-size:12.8px">8 decimal digits? How does that work? In practice, is it 7 or 8?</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">In the example we see that </span><span style="font-size:12.8px">4/3 == 1.33333333 (8 "3") - so it's </span><span style="font-size:12.8px">8 decimal digits...</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I have a work around using expr. Just put the number in parenthesis.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Try [expr 4./3 == (1.33333333)] (8 "3")</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">but the thing is that this is also true - </span><span style="font-size:12.8px"> </span><span style="font-size:12.8px">[expr 4./3 == (1.3333333)]</span><span style="font-size:12.8px"> -</span><span style="font-size:12.8px"> also equal to 7 "3"</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">cheers</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-01-29 14:58 GMT-02:00 Cyrille Henry <span dir="ltr"><<a href="mailto:ch@chnry.net" target="_blank">ch@chnry.net</a>></span>:<div><div><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">hello,<br>
<br>
ok, claude was faster to answer, but since i already write my mail, i send it anyway...<br>
<br>
<br>
pd internal resolution is float32.<br>
(i.e, 23 bit, so a bit less than 17 millions, i.e more that 7 digit but less than 8 digits)<br>
pd graphical representation is 6 digits<br>
<br>
so, 4/3 =! 1.33333 but 4/3 == 1.33333333 (8 "3")<br>
even if both are represented with the same number of 3...<br>
this is a generic problem of computer float.<br>
<br>
the only odd thing concerning pd is that number are also saved with 6 digit.<br>
(so precision can be lost when a patch is saved)<br>
<br>
try the attachment patch.<br>
then save the patch, and open it back, and see that precision is lost.<br>
(I have to modifies the patch as text file to have this behaviors, but you can also have the save precision when creating an object... until you save/load the patch)<br>
<br>
you can also have a look on the top right of the patch: a weird effect of float precision...<br>
<br>
cheers<br>
c<br>
<br>
Le 29/01/2015 17:17, Alexandre Torres Porres a écrit :<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>
Well, thanks everyone.<br>
<br>
And now for some related issues.<br>
<br>
Pd can only represent up to 6 significant digits, so they say. For example, in a message, you can have a number with up to 5 decimal places, like: -5.29314e+12<br>
<br>
but it does have a better internal resolution, if you compare 4 / 3 to 1.33333 you'll see 4 / 3 is higher ( try [expr 4./3 > 1.33333] and check).<br>
<br>
So, what's this internal resolution? And why can't you have the same resolution in a message?<br>
<br>
thanks<br>
<br></span>
2015-01-28 16:06 GMT-02:00 Martin Peach <<a href="mailto:chakekatzil@gmail.com" target="_blank">chakekatzil@gmail.com</a> <mailto:<a href="mailto:chakekatzil@gmail.com" target="_blank">chakekatzil@gmail.com</a>><u></u>>:<span><br>
<br>
    On Wed, Jan 28, 2015 at 12:00 PM, Cyrille Henry <<a href="mailto:ch@chnry.net" target="_blank">ch@chnry.net</a> <mailto:<a href="mailto:ch@chnry.net" target="_blank">ch@chnry.net</a>>> wrote:<br>
<br>
<br>
<br>
        Le 28/01/2015 17:47, Alexandre Torres Porres a écrit :<br>
<br>
              > it's a limitation of 32 bit float<br>
<br>
            I thought so, but same happens when I use the new Pd Vanilla 64 bits...<br>
<br>
        this mean that it's compiled for 64 bit CPU, not that float are store on 64 bits<br>
<br>
    Also last time I checked, Pd saves floats by first printing them to 6 digit precision, so they have even less range than a 'float' type.<br>
    You could use an object made with pdlua to manipulate large floating-point numbers, as there is no(?) limit to the size of a float in lua.<br>
<br>
    Martin<br>
<br>
    ______________________________<u></u>_________________<br></span>
    <a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> <mailto:<a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a>> mailing list<span><br>
    UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/<u></u>listinfo/pd-list</a><br>
<br>
<br>
</span></blockquote>
</blockquote></div></div></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div></div></div><br></div>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>