

Here is an example that shows the difference in behavior between operands statically typed as floating-point numbers ( Double.NaN) and operands not statically typed as floating-point numbers ( listOf(T)). NaN is considered greater than any other element including POSITIVE_INFINITY In this case, the operations use the equals and compareTo implementations for Float and Double. For example, Any, Comparable, or Collection types. However, to support generic use cases and provide total ordering, the behavior is different for operands that are not statically typed as floating-point numbers. A for loop over a range or an array is compiled to an index-based loop that does not create an iterator object. xxxxxxxxxx val versionRange Version(1, 11). rangeTo () is often called in its operator form. To create a range for your class, call the rangeTo () function on the range start value and provide the end value as an argument. When the operands a and b are statically known to be Float or Double or their nullable counterparts (the type is declared or inferred or is a result of a smart cast), the operations on the numbers and the range that they form follow the IEEE 754 Standard for Floating-Point Arithmetic. The main operation on ranges is contains, which is usually used in the form of in and in operators. Kotlin ranges are created with rangeTo() function, or simply using downTo or (. Range instantiation and range checks: a.b, x in a.b, x !in a.b Kotlin range is defined by its two endpoint values which are both included in the range. The operations on floating-point numbers discussed in this section are: Here is the complete list of bitwise operations:
