|
|||||||||||
Technical Support Support Resources
Product Information |
GENERAL: Converting Floating-point Number to IntegerInformation in this article applies to:
QUESTIONI would like to convert a floating-point number to an integer. Is there a standard math library routine to accomplish this? ANSWERNo. The C Programming Language does not require library routines to perform simple type conversions. Types are converted using implicit type casting. For example:
In the above example, the value of the floating-point variable f is converted to a long value and is assigned to l. If the value of f is outside the range of values for a long type, the maximum positive or negative long value is assigned to l. The value ranges for the following integer and floating point types are shown below;
MORE INFORMATION
SEE ALSOLast Reviewed: Thursday, February 25, 2021 | ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.