|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: Floating Points and rounding
Hmm, I use (for example):
Code:
double PAN_DEGREE = whatever I didn't know about the "f" after the numbers after, but I'd seen that at some point...can't remember where. Thanks, I'll use some of that in my code! JBot |
|
#2
|
||||
|
||||
|
Re: Floating Points and rounding
Quote:
|
|
#3
|
|||
|
|||
|
Re: Floating Points and rounding
If you are only going up to 180 i don't see why a float is really necessary??? why not just multiply by 100? it'll still get you two digit accuracy
i.e: 180.00 = 18000 as for rounding a floating point number down to four decimals... it is not too hard to do, but why would you need to do it? it's not like reducing the number of decimal points will reduce the processing time more than the cost it takes to round the number. I think the easiest way to round to four decimals would probably be to mask off the bits of the less significant digits using "&" and a masking variable (look up bitwise operators) this may also be of use to u: http://en.wikipedia.org/wiki/IEEE_754 |
|
#4
|
||||
|
||||
|
Re: Floating Points and rounding
floats and doubles are both 32bit variables in this compiler!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Rounding numbers | teh_pwnerer795 | Programming | 13 | 17-12-2006 12:16 |
| pic: Team 228 and the floating tetra | artdutra04 | Extra Discussion | 8 | 02-05-2005 19:58 |
| pic: YMTC: 150 points or 100 points? | CD47-Bot | Extra Discussion | 4 | 25-03-2004 01:53 |
| 5 points I make..(and a little excess) | archiver | 1999 | 7 | 23-06-2002 22:18 |
| Awards and points... | Ian W. | Rules/Strategy | 4 | 24-03-2002 13:30 |