Skip to content
Subhajit Sahu edited this page Feb 11, 2020 · 20 revisions

Gets absolute value of 32-bit integer (xor method).

integer.abs(x);
// x: an integer
const integer = require('extra-integer');

integer.abs(-92);
// 92

integer.abs(61);
// 61

integer.abs(-68);
// 68

references

Clone this wiki locally