jacob ·
x = pow(-1,4);
Why does this code show me -1.#IND on the streamout? Instead of correct value -> 1.
From the original SynthMaker forum (2004–2014), with its members’ names and dates.
jacob ·
x = pow(-1,4);
Why does this code show me -1.#IND on the streamout? Instead of correct value -> 1.
CoreStyler ·
You will never get >4. At least you will get 4. To do a statement is better to use green data, and streambool out the result (0 is false, 1 is true). and -1 * -1 *-1 *-1 = 1.
jacob ·
CoreStyler wrote: You will never get >4. At least you will get 4. To do a statement is better to use green data, and streambool out the result (0 is false, 1 is true).
Sorry, that was wrong. I want 1 to come out and not the 4 I mentioned first.
CoreStyler ·
jacob wrote: CoreStyler wrote: You will never get >4. At least you will get 4. To do a statement is better to use green data, and streambool out the result (0 is false, 1 is true).
Sorry, that was wrong. I want 1 to come out and not the 4 I mentioned first.
Done. you want to have a negative phase?
To calculate: pow (-1,4) synthmaker not work (don't know why). But doing pow (1,4) * -1 does. 😉
And with your code you bypassed the input. So i addedd out = in + pow(1,4) * -1; instead of out = pow(1,4) * -1; Because you bypass the input that does not affect anything.
jacob ·
CoreStyler wrote: Done. you want to have a negative phase?
To calculate: pow (-1,4) synthmaker not work (don't know why). But doing pow (1,4) * -1 does. 😉
And with your code you bypassed the input. So i addedd out = in + pow(1,4) * -1; instead of out = pow(1,4) * -1; Because you bypass the input that does not affect anything.
Thank you for your very fast answers and the osm. but this is not what I was after. I want 1 be negative or positive depending on the exponent. So every even number (2,4,6,...) makes it positive: (-1)^4 = (-1)*(-1)*(-1)*(-1) = 1 And every uneven number (1,3,5,...) makes it negative: (-1)^3 = (-1)*(-1)*(-1) = -1
jacob ·
I solved it with another calculation. Dividing the variable by 2 and checking if it has decimal places - by checking it against the rounded value. But it would be better if the pow() would work.
martinvicanek ·
SM's implementation of pow() allows for non-integer exponents hence it expects a positive base to make sure that the result is a real (not a complex) number.
jacob ·
martinvicanek wrote: SM's implementation of pow() allows for non-integer exponents hence it expects a positive base to make sure that the result is a real (not a complex) number.
Thank you for this info.
Wrote something here? To have a post removed or your name hidden, write to [email protected].