|
Page 1 of 1
|
[ 2 posts ] |
|
calculation problem.. need help
| Author |
Message |
|
sam1741
Rookie
Joined: Sun Sep 09, 2012 5:08 am Posts: 1
|
 calculation problem.. need help
hi everyone
i am new here, new to robotC too
After some frustrating time searching for my error in my program i notice that, robotC cant divide number with the one bigger to it
example
// i wanted to get some decimal number, from different number // after few try, i put in number to see how it react float aangle = abs(50/100) ; nxtDisplayString(2, "angle : %f", aangle);
anyone can help me please? all i getting is 0.
thanks
|
| Sun Sep 09, 2012 5:15 am |
|
 |
|
mightor
Moderator
Joined: Wed Mar 05, 2008 8:14 am Posts: 2861 Location: Rotterdam, The Netherlands
|
 Re: calculation problem.. need help
Try float foo = abs(50.0/100.0);
- Xander
_________________| Some people, when confronted with a problem, think, "I know, I'll use threads," | and then two they hav erpoblesms. (@nedbat)| My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
| Sun Sep 09, 2012 5:51 am |
|
|
|
Page 1 of 1
|
[ 2 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 10 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
|
|