View unanswered posts | View active topics It is currently Sat Oct 25, 2014 9:53 pm






Reply to topic  [ 3 posts ] 
**Error**:Operator: '%'. Illegal on operands of type '' 
Author Message
Rookie
User avatar

Joined: Tue Aug 11, 2009 11:49 pm
Posts: 38
Location: Tasmania, the Land Down Under, the Land Downunder!
Post **Error**:Operator: '%'. Illegal on operands of type ''
Hi Guys,

I'm having this issue pop-up when I try to compile a piece of code: **Error**:Operator: '%'. Illegal on operands of type ''

Code:
void calcMyAngle() {
  useAngle = (x != 0 || y != 0);
  myAngle = atan2(-y, x);
  if (myAngle < 0)  myAngle += TWO_PI;
  myAngle = (myAngle + HALF_PI) % TWO_PI;
}


Can someone please inform me to where I've gone wrong?


Attachments:
HolonomicPS2.c [4.56 KiB]
Downloaded 26 times

_________________
regards

Sparra Mc


Image
Mon May 26, 2014 12:36 am
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3227
Location: Rotterdam, The Netherlands
Post Re: **Error**:Operator: '%'. Illegal on operands of type ''
You cannot use floats and modulus. Modulus works with whole numbers only.

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Mon May 26, 2014 2:07 am
Profile WWW
Rookie
User avatar

Joined: Tue Aug 11, 2009 11:49 pm
Posts: 38
Location: Tasmania, the Land Down Under, the Land Downunder!
Post Re: **Error**:Operator: '%'. Illegal on operands of type ''
Thanx Xander.

I was confident I was doing something silly.

_________________
regards

Sparra Mc


Image


Mon May 26, 2014 8:13 am
Profile WWW
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.