This might be silly, but here are three abstractions I made a couple years or so when I was learning...
the "nearest" one defaults to the higher value for numbers halfway between.
Matt
Date: Fri, 12 Dec 2008 00:48:48 +0900 From: "hard off" hard.off@gmail.com Subject: [PD] nearest power of 2 To: "Pd List" pd-list@iem.kug.ac.at Message-ID: 161320dd0812110748w620d032g7b9bdff22d2f4fe7@mail.gmail.com Content-Type: text/plain; charset="iso-8859-1"
what's the easiest way for pd to find the nearest power of 2 for any float?
so 10 would give a result of 8, 53 would give a result of 64,
etc..
http://en.wikipedia.org/wiki/Power_of_two#Algorithm_to_convert_any_number_in...