Abstract
This chapter treats the important subject of converting arbitrary floating-point numbers to whole numbers, where the results may be in either floating-point or integer data formats. A few important historical machines targeted at the scientific computing market, and described in Appendix H on page 947, make such conversions easy by virtue of not having a separate integer storage format. Integers are then just floating-point values with a zero exponent, and conversions may require little more than bit shifting, and possibly, rounding. Some scripting languages provide only numbers and strings, where all numbers are represented as floating-point values.
I have found a bug on qemu SPARC: the floating point to integer conversion instructions (fstoi, fdtoi, fstox, fdtox) are not correctly emulated.
— Aurelien Jarno
bug report to qemu-devel mailing list (2007).
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2017 Springer International Publishing AG
About this chapter
Cite this chapter
Beebe, N.H.F. (2017). Converting floating-point values to integers. In: The Mathematical-Function Computation Handbook. Springer, Cham. https://doi.org/10.1007/978-3-319-64110-2_6
Download citation
DOI: https://doi.org/10.1007/978-3-319-64110-2_6
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-64109-6
Online ISBN: 978-3-319-64110-2
eBook Packages: Computer ScienceComputer Science (R0)