May 10, 2013 at 3:29pm UTC
I know that the rule of indecies or powers is that ap/q =q ^ap
but how the hell can I work out 2*x-1/4
I cannot grasp the maths in my head no matter how many tutorials I watch, then I need to suss out how to get code to do it.
maybe I should find a maths forum, the programming doesnt have to be an issue once I know it making a function should be easy,
well nice challenge here for maths lovers.
May 10, 2013 at 4:31pm UTC
simple:
n^-1 = 1/n
n^-(1/4)
= 1/ (n ^1/4)
May 10, 2013 at 5:39pm UTC
hey could you annotate that?
May 10, 2013 at 5:44pm UTC
No Idea what you mean by annotate?
n^-q = 1/n^q?
May 10, 2013 at 5:45pm UTC
Negative power means inverse and powers are (pow er/root) eg2^2/1 is really 1root(2^2). And 2^2/2 is really sqroot(2^2) = sqroot(4) = 2
Last edited on May 10, 2013 at 9:13pm UTC
May 10, 2013 at 5:49pm UTC
2^2 is sqrt(4) is 2?
If that is what you mean, I woud "tend" to say, you are not right about that ;)
negative power means just this:
n^-q = 1/n^q.
so, n^-(1/4)
= 1/(n^(1/4))
Last edited on May 10, 2013 at 5:51pm UTC
May 10, 2013 at 6:37pm UTC
I was on my phone and I edited it was meant to be 2^2/2 and I know what 2^2 is as you can see earlier i said that 2 ^2 is 1root ( 2 ^ 2 )
Last edited on May 10, 2013 at 6:37pm UTC
May 10, 2013 at 6:47pm UTC
yep! Typos can happen! :)
Last edited on May 10, 2013 at 6:47pm UTC
May 10, 2013 at 8:47pm UTC
I know that the rule of indecies or powers is that ap/q=q^ap
That doesn't look right to me.
a^(p/q) = q_root(a^p) = (q_root(a))^p
as already mentioned, negative exponents just put it into denominator (with positive exponent)
Your example 2x^-(1/4) = [2/x^(1/4)] = 2/4root(x)
Hope that makes some sense.
@giblit
Neither of your posts make any sense to me, are you saying 2^2 is equivalent to sqrt(2^2)?
@devonrevenge
This really doesn't belong in this forum, maybe move it to the lounge?
Last edited on May 10, 2013 at 8:54pm UTC
May 10, 2013 at 9:12pm UTC
Would 2^2/3 be easier to understand than 2^2/2
Last edited on May 10, 2013 at 9:16pm UTC
May 10, 2013 at 9:19pm UTC
yeah, It was for a program but i realize its got no coding in it yet
Last edited on May 10, 2013 at 9:19pm UTC
May 10, 2013 at 11:54pm UTC
I think the pow() function does negative and decimals (sorry I thought I posted earlier) otherwise you can do a function manually I coded one earlier..I'll try and find it and put it here shortly
EDIT: yes it does work with negative and decimals
1 2 3 4 5 6 7 8 9
#include <iostream>
#include <math.h>
int main ( void )
{
std::cout << pow( 2 , 2 ) << std::endl;
std::cout << pow( 2 , -2 ) << std::endl;
std::cout << pow( 2 , .5 ) << std::endl;
std::cout << pow( 2 , -.5 ) << std::endl;
}
4
0.25
1.41421
0.707107
Process returned 0 (0x0) execution time : 0.184 s
Press any key to continue.
Last edited on May 10, 2013 at 11:58pm UTC
May 11, 2013 at 4:53pm UTC
HA! this saves me from actually having to understand it :P