[PD] next power of two?

Peter P. peterparker at fastmail.com
Sat Mar 9 12:43:07 CET 2019


* Peter P. <peterparker at fastmail.com> [2019-03-09 12:23]:
> Hi,
> 
> struggling with the search engine results (basically not having matches)
> on https://lists.puredata.info/pipermail/pd-list/ I wonder how to
> calculate the next larger power of two for a given number?

Seemed not too hard to do, please excuse the noise. My solution is
attached for reference and future use.
-------------- next part --------------
#N canvas 898 307 582 627 12;
#X text 68 11 calculate next larger power of two;
#X obj 184 113 log;
#X obj 230 112 log;
#X msg 230 86 2;
#X obj 230 61 loadbang;
#X obj 184 204 t f f;
#X obj 184 171 /;
#X obj 202 231 i;
#X obj 184 289 -;
#X obj 184 385 i;
#X obj 184 317 sel 0;
#X obj 184 533 pow;
#X msg 184 505 2;
#X obj 184 479 t b f;
#X obj 216 384 t b;
#X obj 216 441 + 1;
#X obj 202 261 t f f f;
#X obj 216 415 i;
#X obj 165 78 inlet;
#X obj 164 576 outlet;
#X text 280 583 (c)2019 Peter P. under the BSD license;
#X connect 1 0 6 0;
#X connect 2 0 6 1;
#X connect 3 0 2 0;
#X connect 4 0 3 0;
#X connect 5 0 8 0;
#X connect 5 1 7 0;
#X connect 6 0 5 0;
#X connect 7 0 16 0;
#X connect 8 0 10 0;
#X connect 9 0 13 0;
#X connect 10 0 9 0;
#X connect 10 1 14 0;
#X connect 11 0 19 0;
#X connect 12 0 11 0;
#X connect 13 0 12 0;
#X connect 13 1 11 1;
#X connect 14 0 17 0;
#X connect 15 0 13 0;
#X connect 16 0 8 1;
#X connect 16 1 9 1;
#X connect 16 2 17 1;
#X connect 17 0 15 0;
#X connect 18 0 1 0;


More information about the Pd-list mailing list