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