Skip to content

Int

An integer.

Parent type: Float

Examples:

pipeline example {
    val int = 1;
}
Stub code in coreClasses.sdsstub

class Int sub Float {

    /**
     * Convert this integer to a floating-point number.
     *
     * @example
     * pipeline example {
     *     val float = 1.toFloat(); // 1.0
     * }
     */
    @Pure
    @PythonMacro("float($this)")
    fun toFloat() -> float: Float
}

toFloat

Convert this integer to a floating-point number.

Results:

Name Type Description
float Float -

Examples:

pipeline example {
    val float = 1.toFloat(); // 1.0
}
Stub code in coreClasses.sdsstub

@Pure
@PythonMacro("float($this)")
fun toFloat() -> float: Float

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