FAILURE MAP
← Case archive

FA-89884 / Bytecode virtual machines / Member archive

JVM int32 opcodes: irem follows the divisor sign · case 04

Remainders of negative dividends come out positive (-10 % 3 gives 2).

Member previewVariant 4 · 3 implementations · 8 checks per implementation

Case contract

Each op is [name, a, b] over 32-bit two's complement ints: iadd/imul wrap; idiv truncates toward zero and MIN_VALUE / -1 wraps to MIN_VALUE; irem has the sign of the dividend; ishl/ishr/iushr use only the low five bits of the shift count, iushr shifts in zeros; ineg wraps. Division by zero yields "ArithmeticException", an unknown op "VerifyError".

Why this case matters

Bytecode integer opcodes must reproduce fixed-width semantics that host-language integers do not.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
irem takes the sign of the dividend[2, -1][-1, 2]Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗