View unanswered posts | View active topics It is currently Mon Jul 28, 2014 3:16 pm






Reply to topic  [ 5 posts ] 
Are functions like Mod available or in the pipeline? 
Author Message
Novice

Joined: Sun Feb 04, 2007 12:48 am
Posts: 69
Location: Australia
Post Are functions like Mod available or in the pipeline?
Hi,

Are mathematical functions like mod being instituted into RobotC?

Eg

nIteration = 10 Mod 3; // Returns the remainder 1.

Thanks
James


Sat Mar 17, 2007 1:57 am
Profile
Rookie

Joined: Fri Mar 16, 2007 9:12 am
Posts: 26
Post 
Yep, I just tested, and it looks like mod's in there..

Code:
task main()
{
   int test = 5%2;
}


Following the global variables in the debugger reveals test = 1 after it gets initialized here.
:D


Sat Mar 17, 2007 4:04 pm
Profile
Novice

Joined: Sun Feb 04, 2007 12:48 am
Posts: 69
Location: Australia
Post 
Thanks again HoTWiReZ,

Very helpful. Any suggestions on a good source for someone with experience in VB to find commands like this one relating to c based languages.

It would be unlikely that I would have been able to work out how to get remainders without guidance or creating some very clunky code.

Thanks,
James


Sun Mar 18, 2007 5:18 am
Profile
Rookie

Joined: Fri Mar 16, 2007 9:12 am
Posts: 26
Post 
I'm not sure about any VB to C books or sites, but I think a simple intro to C++ book would help since the ideas are the same, but C generally has more things to watch out for as there are less safeties built in.


Sun Mar 18, 2007 2:13 pm
Profile
Novice

Joined: Sun Feb 04, 2007 12:48 am
Posts: 69
Location: Australia
Post 
Thank you.


Tue Mar 20, 2007 4:20 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 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:  



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