|
Page 1 of 1
|
[ 5 posts ] |
|
Author |
Message |
billyb29
Rookie
Joined: Sun Nov 30, 2014 4:56 am Posts: 14
|
 Binary numbers in RobotC
Hello guys, I was just checking the question here http://www.robotc.net/forums/viewtopic.php?p=3144. But I was wondering if any changes happened and if there is something similar to <bitset> in C++ so I can print the binary representation of a number. Thanks for the help.
Last edited by billyb29 on Fri May 22, 2015 10:11 am, edited 1 time in total.
|
Thu May 21, 2015 10:54 am |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: Binary numbers in RobotC
Hi there,
I think the only way you could print a binary number is by looping through the bits and printing them individually.
= 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]
|
Fri May 22, 2015 6:02 am |
|
 |
billyb29
Rookie
Joined: Sun Nov 30, 2014 4:56 am Posts: 14
|
 Re: Binary numbers in RobotC
Hello Xander,
So you mean if I have let's say a long long number, I would have to convert it to binary my self, and print the bits correct?
Nabil
|
Fri May 22, 2015 9:17 am |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: Binary numbers in RobotC
Yeah, simply iterate through the number's bits, which you can print out individually, or store in a temporary array and then print.
= 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]
|
Fri May 22, 2015 11:13 am |
|
 |
billyb29
Rookie
Joined: Sun Nov 30, 2014 4:56 am Posts: 14
|
 Re: Binary numbers in RobotC
Thanks Xander, I really appreciate the help.
Nabil
|
Sat May 23, 2015 8:59 pm |
|
|
|
Page 1 of 1
|
[ 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
|
|