Quantcast

Zero-Crossing in a Pbind

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Zero-Crossing in a Pbind

bobby donnegan
I noticed that if I cross from a negative number to a positive number,
I get a pretty elaborate irrational number (if that's the right
term..) at the crossing point.
In this case: 1.3877787807814e-16

I'm wondering if anyone knows what causes this or if it's a problem, etc..

(
var a, b;
a = Pseries(1, -0.1, 20);

x = a.asStream;
20.do({ x.next.postln; });
)

--
--Bobby D.--

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Zero-Crossing in a Pbind

Daniel Mayer

Am 11.03.2017 um 22:50 schrieb Bobby Donnegan <[hidden email]>:

> I noticed that if I cross from a negative number to a positive number,
> I get a pretty elaborate irrational number (if that's the right
> term..) at the crossing point.
> In this case: 1.3877787807814e-16
>
> I'm wondering if anyone knows what causes this or if it's a problem, etc..
>


Normal floating point inaccuracy, in this context probably no problem
(depends what you do with the numbers).

If you mind the strange posting you can always round

(
var a, b;
a = Pseries(1, -0.1, 20).round(1e-6);

x = a.asStream;
20.do({ x.next.postln; });
)

Regards

Daniel

-----------------------------
www.daniel-mayer.at
-----------------------------


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Zero-Crossing in a Pbind

Daniel Mayer

Am 12.03.2017 um 00:02 schrieb Daniel Mayer <[hidden email]>:

>
> Am 11.03.2017 um 22:50 schrieb Bobby Donnegan <[hidden email]>:
>
>> I noticed that if I cross from a negative number to a positive number,
>> I get a pretty elaborate irrational number (if that's the right
>> term..) at the crossing point.
>> In this case: 1.3877787807814e-16
>>
>> I'm wondering if anyone knows what causes this or if it's a problem, etc..
>>
>
>
> Normal floating point inaccuracy, in this context probably no problem
> (depends what you do with the numbers).


Right, on the other hand, what's the standard way to force a float in exponential
form to be posted in decimal form resp. convert it to a decimal form in a String, is there one at all ?

Recent and older discussions seem to indicate that there's none:

http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/asStringPrec-does-not-seem-to-work-td7630979.html
http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/asStringPrec-td5826156.html

I just looked up my old implementation of handling very large decimal numbers in the VarGui interface
(help file Ex. 9, slider step precision)

Also here, it has to employ some unpleasant fiddling in dedicated conversion methods (miSC_decimalStrings) ...


Anyway the more general topic of asStringPrec has already been put on the agenda of devs:

http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Meeting-minutes-2017-03-04-td7631002.html#a7631006



Greetings

Daniel

-----------------------------
www.daniel-mayer.at
-----------------------------


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Loading...