times
Multiplies this integer by the other one.
Calling from Kotlin
Here's an example of calling this function from Kotlin code:
val x: NonZeroInteger = NonZeroInteger.fromLong(99999999999999999)
val y: NonZeroInteger = NonZeroInteger.fromLong(10)
val result: NonZeroInteger = x * y
val expected: NonZeroInteger =
NonZeroInteger.parse("999999999999999990")
check(result == expected)Content copied to clipboard
Calling from Java
Here's an example of calling this function from Java code:
final NonZeroInteger x = NonZeroInteger.fromLong(99999999999999999L);
final NonZeroInteger y = NonZeroInteger.fromLong(10L);
final NonZeroInteger result = x.times(y);
final NonZeroInteger expected =
NonZeroInteger.parse("999999999999999990");
final boolean check = result.equals(expected);
if (!check) throw new IllegalStateException("Check failed.");Content copied to clipboard