04-23-2008, 11:54 AM
Hi Ralph,
Sure I will try to explain you what POW means:
Like in qbasic there is in C a mathematical function to compute the power exponent.
In qbasic we use ^ but in C it is called POW.
I will give some more example in both C and bqasic so you can see the differences.
Example in C
 printf ("7 ^ 3 = %lf\n", pow (7,3));
 printf ("4.73 ^ 12 = %lf\n", pow (4.73,12));
 printf ("32.01 ^ 1.54 = %lf\n", pow (32.01,1.54));
Example in qbasic
 print "7 ^ 3 = ", 7 ^ 3
 print "4.73 ^ 3 = ", 4.73 ^ 12
 print "32.01 ^ 1.54 = ", 32.01 ^ 1.54
Both should output something like this:
7 ^ 3 = 343.000000
4.73 ^ 12 = 125410439.217423
32.01 ^ 1.54 = 208.036691
Please forget the C syntax you see in the example.
A correct translation (according to this challenge) should translate print 3 ^ 7 to print pow(3,7).
Now this looks easy but things start to get more complicated when translating
print (10 ^ 2) - 5 + (21 * (3 - 4 ^ 6) * 2 + 10 - 5) ^ 2 + 3 - (3 + 7) + 99
To
print pow(10,2))-5+pow((21*(3-pow(4,6))*2+10-5),2)+3-(3+7)+99)
I hope that helped a little.
Kind regards,
Frontrunner
Sure I will try to explain you what POW means:
Like in qbasic there is in C a mathematical function to compute the power exponent.
In qbasic we use ^ but in C it is called POW.
I will give some more example in both C and bqasic so you can see the differences.
Example in C
 printf ("7 ^ 3 = %lf\n", pow (7,3));
 printf ("4.73 ^ 12 = %lf\n", pow (4.73,12));
 printf ("32.01 ^ 1.54 = %lf\n", pow (32.01,1.54));
Example in qbasic
 print "7 ^ 3 = ", 7 ^ 3
 print "4.73 ^ 3 = ", 4.73 ^ 12
 print "32.01 ^ 1.54 = ", 32.01 ^ 1.54
Both should output something like this:
7 ^ 3 = 343.000000
4.73 ^ 12 = 125410439.217423
32.01 ^ 1.54 = 208.036691
Please forget the C syntax you see in the example.
A correct translation (according to this challenge) should translate print 3 ^ 7 to print pow(3,7).
Now this looks easy but things start to get more complicated when translating
print (10 ^ 2) - 5 + (21 * (3 - 4 ^ 6) * 2 + 10 - 5) ^ 2 + 3 - (3 + 7) + 99
To
print pow(10,2))-5+pow((21*(3-pow(4,6))*2+10-5),2)+3-(3+7)+99)
I hope that helped a little.
Kind regards,
Frontrunner