i know of a long way to do this, but i think i remember hearing of an object that does division primary school style. ie, gives a whole number and a remainder.
eg. 7 / 2 = 3 remainder 1
what's the object?
hard off wrote:
i know of a long way to do this, but i think i remember hearing of an object that does division primary school style. ie, gives a whole number and a remainder.
eg. 7 / 2 = 3 remainder 1
what's the object?
integer division: [/]+[int]
remainder: [%], [mod]
mf.asdr. IOhannes
Hallo, IOhannes m zmoelnig hat gesagt: // IOhannes m zmoelnig wrote:
hard off wrote:
i know of a long way to do this, but i think i remember hearing of an object that does division primary school style. ie, gives a whole number and a remainder.
eg. 7 / 2 = 3 remainder 1
what's the object?
integer division: [/]+[int]
I prefer [div]. There also is [divmod] in maxlib, but I still prefer [div] ... and [mod] in that case.
Frank Barknecht _ ______footils.org_ __goto10.org__
On Thu, 11 May 2006, Frank Barknecht wrote:
[div] ... and [mod] in that case.
Some definitions of [mod] extend it to be able to use the real numbers as first parameter. So 2.45 mod 2 would be 0.45. I think this could be a good extension to Pd's mod object, and it should also be backwards compatible to its current behaviour. The change inside the code would be trivial. Question is how many patches depend on the truncation after the mod operation.
Günter
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Fri, 12 May 2006, geiger wrote:
On Thu, 11 May 2006, Frank Barknecht wrote:
[div] ... and [mod] in that case.
Some definitions of [mod] extend it to be able to use the real numbers as first parameter. So 2.45 mod 2 would be 0.45. I think this could be a good extension to Pd's mod object, and it should also be backwards compatible to its current behaviour. The change inside the code would be trivial. Question is how many patches depend on the truncation after the mod operation.
I think that [mod] should probably do whatever ANSI C or ISO math stuff does, which I think it currently is doing. Most programming languages follow these conventions, so its a good idea for Pd to as well.
But the object you propose does sound handy, so maybe it should be a separate object, like [floatmod].
.hc
Günter
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
zen
\
\
\[D[D[D[D
Hans-Christoph Steiner wrote:
I think that [mod] should probably do whatever ANSI C or ISO math stuff does, which I think it currently is doing. Most programming languages follow these conventions, so its a good idea for Pd to as well.
But the object you propose does sound handy, so maybe it should be a separate object, like [floatmod].
it sounds so handy that there are even implementations for it: the built-in [wrap~] is kind of a [floatmod 1]
based on that name, there is a [wrap] in zexy which does the same for floats _and_ which has a settable range to be wrapped into, e.g [wrap 2] should return 0.45 when it receives "2.45".
i am pretty sure this object could also be built with standard objects.
mfg.asdr IOhannes
On Mon, 15 May 2006, Hans-Christoph Steiner wrote:
I think that [mod] should probably do whatever ANSI C or ISO math stuff does, which I think it currently is doing. Most programming languages follow these conventions, so its a good idea for Pd to as well.
[%] follows C convention. [mod] does not, mostly because [%] is often not what is wanted: for example, both Python and Ruby define % to be like Pd's [mod] and not like Pd's [%].
But the object you propose does sound handy, so maybe it should be a separate object, like [floatmod].
It would also be nice if it supported that its right-hand value is a float. This would be useful for normalizing angles that are in radians.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
Hello.
I've been experimenting with Linux PPC and am loving it! However, I
cannot find the source code to OSCx (looks like the sourceforge page
is down). Can anyone please send it to me or give me a working link
to it?
Thanks, Julian Peterson
Julian Peterson wrote:
Hello.
I've been experimenting with Linux PPC and am loving it! However, I cannot find the source code to OSCx (looks like the sourceforge page is
works for me. however,the URL has changed http://pure-data.cvs.sourceforge.net/pure-data/ (from which page did you try to access it, so we can fix broken links?)
mfg.asdr. IOhannes
down). Can anyone please send it to me or give me a working link to it?
Thanks, Julian Peterson
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Google : )
Works for me now, too. Thanks,
JP
On May 16, 2006, at 10:17 AM, IOhannes m zmoelnig wrote:
Julian Peterson wrote:
Hello. I've been experimenting with Linux PPC and am loving it! However,
I cannot find the source code to OSCx (looks like the sourceforge
page isworks for me. however,the URL has changed http://pure-data.cvs.sourceforge.net/pure-data/ (from which page did you try to access it, so we can fix broken
links?)mfg.asdr. IOhannes
down). Can anyone please send it to me or give me a working link
to it?Thanks, Julian Peterson _______________________________________________ PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
On Mon, 15 May 2006, Hans-Christoph Steiner wrote:
On Fri, 12 May 2006, geiger wrote:
On Thu, 11 May 2006, Frank Barknecht wrote:
[div] ... and [mod] in that case.
Some definitions of [mod] extend it to be able to use the real numbers as first parameter. So 2.45 mod 2 would be 0.45. I think this could be a good extension to Pd's mod object, and it should also be backwards compatible to its current behaviour. The change inside the code would be trivial. Question is how many patches depend on the truncation after the mod operation.
I think that [mod] should probably do whatever ANSI C or ISO math stuff does, which I think it currently is doing. Most programming languages follow these conventions, so its a good idea for Pd to as well.
But the object you propose does sound handy, so maybe it should be a separate object, like [floatmod].
AFAIK there is no ANSI C or ISO math mod function, just a % operator, which is currently doing the same.
Guenter
.hc
Günter
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
zen
\[D[D[D[D
hi,
Am Donnerstag, 11. Mai 2006 13:44 schrieb hard off:
i know of a long way to do this, but i think i remember hearing of an object that does division primary school style. ie, gives a whole number and a remainder.
eg. 7 / 2 = 3 remainder 1
what's the object?
to get the remainder, it is the modulo operator, [%]
greets,
chris
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list