• 0 Vote(s) - 0 Average
• 1
• 2
• 3
• 4
• 5
 Mathematical expression translator Frontrunner Junior Member  Posts: 16 Threads: 1 Joined: Apr 2008 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 « Next Oldest | Next Newest »

 Messages In This Thread Mathematical expression translator - by Frontrunner - 04-21-2008, 06:15 PM Re: Mathematical expression translator - by wildcard - 04-21-2008, 11:48 PM Re: Mathematical expression translator - by Frontrunner - 04-22-2008, 12:08 AM Re: Mathematical expression translator - by wildcard - 04-22-2008, 12:17 PM Re: Mathematical expression translator - by Frontrunner - 04-22-2008, 02:57 PM Re: Mathematical expression translator - by Ralph - 04-23-2008, 05:40 AM Re: Mathematical expression translator - by Frontrunner - 04-23-2008, 11:54 AM Re: Mathematical expression translator - by Ralph - 04-23-2008, 11:09 PM Re: Mathematical expression translator - by Frontrunner - 04-24-2008, 01:25 AM Re: Mathematical expression translator - by wildcard - 04-24-2008, 02:06 AM Re: Mathematical expression translator - by Frontrunner - 04-24-2008, 02:52 AM Re: Mathematical expression translator - by Ralph - 04-24-2008, 02:56 AM Re: Mathematical expression translator - by wildcard - 04-24-2008, 03:19 AM Re: Mathematical expression translator - by Ralph - 04-24-2008, 07:51 AM Re: Mathematical expression translator - by Frontrunner - 04-25-2008, 01:39 AM Re: Mathematical expression translator - by wildcard - 04-25-2008, 02:30 AM Re: Mathematical expression translator - by Frontrunner - 04-25-2008, 03:23 PM Re: Mathematical expression translator - by Ralph - 04-25-2008, 07:40 PM Re: Mathematical expression translator - by Ralph - 04-26-2008, 12:40 AM Re: Mathematical expression translator - by Frontrunner - 04-26-2008, 01:59 AM Re: Mathematical expression translator - by Ralph - 04-26-2008, 04:33 AM Re: Mathematical expression translator - by Frontrunner - 04-26-2008, 01:48 PM Re: Mathematical expression translator - by Ralph - 04-29-2008, 08:30 AM Re: Mathematical expression translator - by LPG - 04-29-2008, 10:57 AM Re: Mathematical expression translator - by Frontrunner - 04-29-2008, 07:49 PM Re: Mathematical expression translator - by wildcard - 04-30-2008, 02:53 AM Re: Mathematical expression translator - by Frontrunner - 04-30-2008, 03:06 AM Re: Mathematical expression translator - by LPG - 04-30-2008, 09:06 AM Re: Mathematical expression translator - by Frontrunner - 04-30-2008, 02:27 PM Re: Mathematical expression translator - by Frontrunner - 05-03-2008, 07:16 PM Re: Mathematical expression translator - by yetifoot - 05-07-2008, 07:37 PM Re: Mathematical expression translator - by Frontrunner - 05-08-2008, 03:23 AM Re: Mathematical expression translator - by wildcard - 05-13-2008, 06:26 PM Re: Mathematical expression translator - by Frontrunner - 06-02-2008, 02:23 AM Re: Mathematical expression translator - by wildcard - 06-04-2008, 12:29 PM Re: Mathematical expression translator - by Agamemnus - 08-06-2008, 01:17 AM

Forum Jump:

Users browsing this thread: 1 Guest(s) 