From mboxrd@z Thu Jan 1 00:00:00 1970 From: tanure@linux.com (Lucas Tanure) Date: Tue, 22 Nov 2016 16:21:04 +0000 Subject: IEEE-754 Float to int In-Reply-To: References: Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Tue, Nov 22, 2016 at 4:19 PM, Anupam Kapoor wrote: > > On Tue, Nov 22, 2016 at 9:35 PM, Lucas Tanure wrote: > >> So, value has a 32bit float now, and I would like to print just the >> integer part, like : >> Read 26.92387 --> Print 26. >> > > ?how about just typecasting to int ? so : > > int x = (int)(some-float-value) > But this "some-float-value" must be declared as float ? Can I do that ? > > that should be it right ?? > > > ?-- > kind regards > anupam? > > > In the beginning was the lambda, and the lambda was with Emacs, and Emacs > was the lambda. > -- Lucas Tanure Embedded Developer +55 19 988176559 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20161122/827e6e75/attachment-0001.html