Skip to content

abstract class Float

A floating-point number.

Parent type: Number

Examples:

pipeline example {
    val float = 1.0;
}
Stub code in coreClasses.sdsstub
class Float sub Number {

    /**
     * Convert this floating-point number to an integer by truncating the fractional part.
     *
     * @example
     * pipeline example {
     *     val int = 1.0.toInt(); // 1
     * }
     */
    @Pure
    @PythonMacro("int($this)")
    fun toInt() -> int: Int
}

fun toInt

Convert this floating-point number to an integer by truncating the fractional part.

Results:

Name Type Description
int Int -

Examples:

pipeline example {
    val int = 1.0.toInt(); // 1
}
Stub code in coreClasses.sdsstub
@Pure
@PythonMacro("int($this)")
fun toInt() -> int: Int