Pow bug in Gen?

dmn's icon

Hi,
I'm late to the game with Gen.
I'm using the pow function.
If I have [pow 2] and I send it a value of 0 it should return a value of 1, but for some reason it returns a value of 0.
Has anyone else observed this behaviour?

Thanks,
D

Roman Thilenius's icon


mixed inputs? the pow story is not exactly linear.

Max: base, exponent
MSP: exponent, base
Gen: base, exponent
Gen~ : doesnt exist

dmn's icon

Danke!

Graham Wakefield's icon

[pow] certainly does exist in gen~! It has two inputs for base and exponent respectively, just like Max's [pow], the C pow(base, exponent) function, and the equivalent in most common math libraries.

[pow 2] in gen~ replaces the 2nd input with a 2, i.e. it raises the input to the power of 2.

If you want to raise 2 to the power of something in gen~, hook up a [2] to the first input of a [pow] or use an [expr pow(2,in)].

Max Patch
Copy patch and select New From Clipboard in Max.

dmn's icon

Yes. I slightly misread the last post so I figured out the I just had the inputs swapped. In retrospect, I probably should have spotted this. Many thanks for your clarification Graham.
D