Path: blob/main/files/en-us/webassembly/reference/numeric/absolute/index.md
6510 views
------{{WebAssemblySidebar}}
The abs instructions, short for absolute, are used to get the absolute value of a number. That is, it returns x if x is positive, and the negation of x if x is negative.
{{EmbedInteractiveExample("pages/wat/abs.html", "tabbed-standard")}}
Syntax
| Instruction | Binary opcode |
|---|---|
f32.abs | 0x8b |
f64.abs | 0x99 |