View unanswered posts | View active topics It is currently Wed Aug 27, 2014 5:07 am






Reply to topic  [ 3 posts ] 
Multiplication 
Author Message
Rookie

Joined: Tue Feb 04, 2014 1:07 pm
Posts: 4
Post Multiplication
Hi, I am attempting to perform the simple math function seen below, and I am just wondering how to write this correctly to avoid these errors. (**Error**:Undefined variable 'ab'. 'short' assumed.
**Error**:Unexpected token ')'
**Error**:Missing ';' before ')'
**Error**:Unexpected ')' during parsing)

I have the variables a and b set as integers.

1/-2ab


Tue Feb 04, 2014 1:13 pm
Profile
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post Re: Multiplication
This function has to be done like so:

Code:
1 / (-2 * (a * b))


RobotC does not support such algebraic function layouts. They must usually be fully written out like the above.

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Tue Feb 04, 2014 1:22 pm
Profile WWW
Rookie

Joined: Tue Feb 04, 2014 1:07 pm
Posts: 4
Post Re: Multiplication
Thank you so much!


Tue Feb 04, 2014 1:37 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.