SplitScript reference / Numeric / divide

Numeric.divide

Operator

T.divide(other: T) -> T where T: Numeric

Divides by another value of the same numeric type.

This method is also the implementation of the / operator. Integer division truncates toward zero. Integer division by zero and the signed minimum divided by negative one trap, matching WebAssembly arithmetic; floating-point division follows IEEE 754.

Parameters

  • other: The divisor.

Effects: pure

Runtime behavior: available everywhere; synchronous

Examples

Convert milliseconds to seconds

let elapsedSeconds = 15_000u64 / 1_000