Path: blob/main/files/en-us/webassembly/reference/numeric/remainder/index.md
6520 views
------{{WebAssemblySidebar}}
The rem instructions, short for remainder, are used to calculate the remainder left over when one integer is divided by another integer, similar to the % operator in other languages. The rem instructions are only available for the integer types and not for the floating point types.
{{EmbedInteractiveExample("pages/wat/rem.html", "tabbed-taller")}}
Syntax
| Instruction | Binary opcode |
|---|---|
i32.rem_s | 0x6f |
i32.rem_u | 0x70 |
i64.rem_s | 0x81 |
i64.rem_u | 0x82 |