OxL Справочник OxL
РусскийEnglish

method i8.checked_rem

Checked remainder: the remainder, or none on division by zero and on MIN / -1, whose quotient does not fit.

Example:

oxl✓ проверяется в CI
fn main() io {
  print("{(7 as i8).checked_rem(4)} {(7 as i8).checked_rem(0)}")
}
Вывод
3 none
pub(api) fn checked_rem(o: i8) -> i8?

Сложность. O(1).

С версии. 1.0.0-beta

Параметры

ИмяТип
oi8

Возвращает

i8?

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/core/numbers.oxl:1116

См. также