Skip to content
Snippets Groups Projects
Commit 7d878661 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

port from Vanilla: pow~ raising negative numbers to integer powers

parent 1387f9b7
No related branches found
No related tags found
No related merge requests found
......@@ -660,12 +660,10 @@ t_int *pow_tilde_perform(t_int *w)
int n = (int)(w[4]);
while (n--)
{
t_float f = *in1++;
if (f > 0)
*out = pow(f, *in2);
else *out = 0;
out++;
in2++;
t_sample f1 = *in1++, f2 = *in2++;
*out++ = (f1 == 0 && f2 < 0) ||
(f1 < 0 && (f2 - (int)f2) != 0) ?
0 : pow(f1, f2);
}
return (w+5);
}
......@@ -678,11 +676,10 @@ t_int *scalarpow_tilde_perform(t_int *w)
int n = (int)(w[4]);
while (n--)
{
t_float f = *in++;
if (f > 0)
*out = pow(f, g);
else *out = 0;
out++;
t_sample f1 = *in++;
*out++ = (f1 == 0 && g < 0) ||
(f1 < 0 && (g - (int)g) != 0) ?
0 : pow(f1, g);
}
return(w+5);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment