Martin Peach chakekatzil at gmail.com
Sat Jan 31 21:23:35 CET 2015

```I tried this using c on Windows:

float:
Pi is 3.14159274101257320000000000000
double:
Pi is 3.14159265358979310000000000000
, which matches the supercollider value:
3.1415926535898

My lpi.pd_lua also gives 3.141592653589793100 on WIndows but on linux I got
48 digits after the decimal:
3.1415926535897931159979634685441851615905761718750000

And from http://www.piday.org/million/ the first 54 digits of pi are these:

3.14159265358979323846264338327950288419716939937510582

So a float is accurate to 6 decimal places, a double is accurate to 15, and
supercollider rounds the double to 13.
Lua on linux gives 48 digits but it's also only accurate to 15.

Martin

On Sat, Jan 31, 2015 at 1:46 AM, Alexandre Torres Porres <porres at gmail.com>
wrote:

> So, cant we raise the bit resolution of pd to more than what's there? how?
>
> Martin, about the pi in lua, i never got to see it, but supercollider
> prints the value of pi as
>
> 3.1415926535898
>
> so thats more than 24 bit float, but what is it?
>
> cheers
>
> 2015-01-29 15:47 GMT-02:00 Martin Peach <chakekatzil at gmail.com>:
>
> Here's a patch using pdlua that shows the value of pi in various ways. I
>> get 48 decimal places in a symbol.
>>
>> Martin
>>
>> On Thu, Jan 29, 2015 at 12:36 PM, Alexandre Torres Porres <
>> porres at gmail.com> wrote:
>>
>>> > more that 7 digit but less than 8 digits
>>> ...
>>> > so, 4/3 =! 1.33333
>>> > but 4/3 == 1.33333333 (8 "3")
>>>
>>> I don't get it. More than 7 decimal digits but less than 8 decimal
>>> digits? How does that work? In practice, is it 7 or 8?
>>>
>>> In the example we see that 4/3 == 1.33333333 (8 "3") - so it's 8
>>> decimal digits...
>>>
>>> I have a work around using expr. Just put the number in parenthesis.
>>>
>>> Try [expr 4./3 == (1.33333333)] (8 "3")
>>>
>>> but the thing is that this is also true -  [expr 4./3 == (1.3333333)] - also
>>> equal to 7 "3"
>>>
>>> cheers
>>>
>>> 2015-01-29 14:58 GMT-02:00 Cyrille Henry <ch at chnry.net>:
>>>
>>> hello,
>>>>
>>>> ok, claude was faster to answer, but since i already write my mail, i
>>>> send it anyway...
>>>>
>>>>
>>>> pd internal resolution is float32.
>>>> (i.e, 23 bit, so a bit less than 17 millions, i.e more that 7 digit but
>>>> less than 8 digits)
>>>> pd graphical representation is 6 digits
>>>>
>>>> so, 4/3 =! 1.33333 but 4/3 == 1.33333333 (8 "3")
>>>> even if both are represented with the same number of 3...
>>>> this is a generic problem of computer float.
>>>>
>>>> the only odd thing concerning pd is that number are also saved with 6
>>>> digit.
>>>> (so precision can be lost when a patch is saved)
>>>>
>>>> try the attachment patch.
>>>> then save the patch, and open it back, and see that precision is lost.
>>>> (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
>>>>
>>>> you can also have a look on the top right of the patch: a weird effect
>>>> of float precision...
>>>>
>>>> cheers
>>>> c
>>>>
>>>> Le 29/01/2015 17:17, Alexandre Torres Porres a écrit :
>>>>
>>>>> Well, thanks everyone.
>>>>>
>>>>> And now for some related issues.
>>>>>
>>>>> 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
>>>>>
>>>>> 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).
>>>>>
>>>>> So, what's this internal resolution? And why can't you have the same
>>>>> resolution in a message?
>>>>>
>>>>> thanks
>>>>>
>>>>> 2015-01-28 16:06 GMT-02:00 Martin Peach <chakekatzil at gmail.com
>>>>> <mailto:chakekatzil at gmail.com>>:
>>>>>
>>>>>     On Wed, Jan 28, 2015 at 12:00 PM, Cyrille Henry <ch at chnry.net
>>>>> <mailto:ch at chnry.net>> wrote:
>>>>>
>>>>>
>>>>>
>>>>>         Le 28/01/2015 17:47, Alexandre Torres Porres a écrit :
>>>>>
>>>>>               > it's a limitation of 32 bit float
>>>>>
>>>>>             I thought so, but same happens when I use the new Pd
>>>>> Vanilla 64 bits...
>>>>>
>>>>>         this mean that it's compiled for 64 bit CPU, not that float
>>>>> are store on 64 bits
>>>>>
>>>>>     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.
>>>>>     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.
>>>>>
>>>>>     Martin
>>>>>
>>>>>     _______________________________________________
>>>>>     Pd-list at lists.iem.at <mailto:Pd-list at lists.iem.at> mailing list
>>>>>     UNSUBSCRIBE and account-management -> http://lists.puredata.info/
>>>>> listinfo/pd-list
>>>>>
>>>>>
>>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20150131/4b606f22/attachment.html>
```