Decimal

suggest change

Bitwise NOT (~) converts its operand with ToInt32, which truncates toward zero, then flips the 32 bits. ~3.5 is ~3. For an integer n, ~n equals -(n + 1), so the result is -4.

let number = 3.5;
let complement = ~number; // -4
let a = ~-2.5; // 1
let b = ~-1.5; // 0
let c = ~0.5;  // -1
let d = ~1.5;  // -2
let e = ~2.5;  // -3

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents