Go to Post Remind me again why anyone, my team included, is stupid enough to keep going to week 1 events? - Madison [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Spotlight this post!  
Unread 09-06-2002, 11:39
VanWEric VanWEric is offline
Registered User
#0250 (Dynamos)
 
Join Date: Feb 2002
Location: NY
Posts: 86
VanWEric is an unknown quantity at this point
word up homies

don't use any floats or doubles anywhere in the program. at all. not even one. the 2sx doesn't have the foggiest of what a decimal point was. What i was trying to say is that although an int will truncate correctly when all is said and told, the math inbetween will not. for example, in pbasic, 5/2*2=4, not 5. C++ will do all the math out with some ungodly precision and then truncate. you may need to change x=x/2*2 to x=x/2; x=x*2.
Also, declaring it as an unsigned might be better, so that you automatically get wrapping up top and below, ie 267 doesnt exist and neither does -6. don't know how to handle the 255 thing with out anal checking in the code.

BTW - i have used words as well (hence the title of the post) and have accessed specific bits in a byte. ie

var variable= 126
variable.bit5=1

good luck getting that to work. I think you'll need to use bit masking or some other craziness
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wheres the list, whats the secret? archiver 2001 3 24-06-2002 01:31
Full list of teams & competitions archiver 2001 14 24-06-2002 00:52
does anyone know where to obtain a regional team list archiver 2001 1 24-06-2002 00:44
Team list & Events archiver 2000 2 23-06-2002 22:39
Suggested list of things to bring to the regionals Andrew Wyatt Technical Discussion 1 06-03-2002 14:41


All times are GMT -5. The time now is 15:42.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi