Checked

object Checked
class Object
trait Matchable
class Any
Checked.type

Value members

Concrete methods

inline def checked[A](inline n: A): A

Performs overflow checking for Int/Long operations.

Performs overflow checking for Int/Long operations.

If no errors are detected, the expected result will be returned. If an error is detected, an ArithmeticOverflowException will be thrown.

inline def option[A](inline n: A): Option[A]

Performs overflow checking for Int/Long operations.

Performs overflow checking for Int/Long operations.

If no errors are detected, the expected result will be returned in a Some wrapper. If an error is detected, None will be returned.

inline def tryOrElse[A](inline n: A)(orElse: => A): A

Performs overflow checking for Int/Long operations.

Performs overflow checking for Int/Long operations.

If no errors are detected, the expected result will be returned. If there are errors, the 'orElse' block will be evaluated and returned.