Creates an integer from the given floating-point value, rounding toward zero.
SDK
- Xcode 6.1+
Framework
- Swift Standard Library
Declaration
Parameters
source
A floating-point value to convert to an integer.
source
must be representable in this type after rounding toward zero.
Discussion
Any fractional part of the value passed as source
is removed, rounding the value toward zero.
If source
is outside the bounds of this type after rounding toward zero, a runtime error may occur.