Are functions like Mod available or in the pipeline?
Author
Message
JamesD
Novice
Joined: Sun Feb 04, 2007 12:48 am Posts: 69 Location: Australia
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
HoTWiReZ
Rookie
Joined: Fri Mar 16, 2007 9:12 am Posts: 26
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.
Sat Mar 17, 2007 4:04 pm
JamesD
Novice
Joined: Sun Feb 04, 2007 12:48 am Posts: 69 Location: Australia
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
HoTWiReZ
Rookie
Joined: Fri Mar 16, 2007 9:12 am Posts: 26
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
JamesD
Novice
Joined: Sun Feb 04, 2007 12:48 am Posts: 69 Location: Australia
Users browsing this forum: No registered users and 1 guest
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