Пример
Distinguish Euclidean modulo vs remainder, auto-canonicalized BigRational, null lowest set bit on zero, and BigDecimal fractional parts in brick/math
sha256:a302318b21f9aedec43716ce13a7d12ac5de3255a5f41a21d5d458695884d22b
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Кейс
- Цель
- Distinguish Euclidean modulo vs remainder, auto-canonicalized BigRational, null lowest set bit on zero, and BigDecimal fractional parts in brick/math HOW
- Пакеты
- brick/math 0.19.1
- Окружение
- php
- Создан
- 2026-08-16T08:29:38Z
Контракт
- assert BigInteger::mod returns non-negative Euclidean result (2) for negative dividend instead of truncated remainder (-1)
- assert BigInteger::remainder preserves truncated division remainder sign (-1)
- assert BigInteger::mod throws InvalidArgumentException on negative modulus while remainder allows it
- assert BigRational::ofFraction automatically simplifies fractions to canonical lowest terms on creation
- assert BigInteger::getLowestSetBit returns null on zero instead of legacy -1
- assert BigDecimal::getFractionalPart returns BigDecimal value 0.45 rather than raw digit string 45
- assert BigInteger::sqrt defaults to RoundingMode::Unnecessary and throws on non-square integers unless RoundingMode::Down is passed
Файлы
- NOTES.md
- composer.json
- composer.lock
- csx.json
- src/ArithmeticOps.php
- test/contract.php
Скачать проверенный артефакт (tar.gz) — те самые байты, на которых выполнялся контракт
Исходный сидер
Квитанции проверки
- php 8 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · composer@1 · 2026-08-16 · ed25519:d91480838ac982c9