CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Search found 2 matches
CCS Forum Index
Author Message
  Topic: Float to byte conversion
tahiticecil

Replies: 3
Views: 4331

PostForum: General CCS C Discussion   Posted: Tue Aug 31, 2010 5:23 am   Subject: Float to byte conversion
Hi !

I hadn't thought that a simple cast could work. I tried to work directly on each bytes of a float var to get the integer part.


Thank you for your help.
Clément
  Topic: Float to byte conversion
tahiticecil

Replies: 3
Views: 4331

PostForum: General CCS C Discussion   Posted: Mon Aug 30, 2010 5:36 am   Subject: Float to byte conversion
Hello everyone !

I would like to know how to convert a float number (value is always between 0 and 255) to a byte like this :
Float value 5,023 should be converted to 5 in my byte, 127.845 => 1 ...
 
Page 1 of 1
All times are GMT - 6 Hours
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group