Re: IEEE-754 Float to int

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Tue, Nov 22, 2016 at 9:35 PM, Lucas Tanure <tanure@xxxxxxxxx> 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)

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.
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux