Tagged articles
7 articles
Page 1 of 1
ITPUB
ITPUB
May 10, 2021 · Fundamentals

Why Do Computers Use Two’s Complement? The Story Behind Binary Number Representation

This article explains why computers use binary and two's complement to represent signed numbers, tracing the evolution from counting on fingers to decimal, Roman numerals, original code, one's complement, and finally two's complement, and shows how these choices simplify hardware design.

Binarycomputer architecturenumber systems
0 likes · 11 min read
Why Do Computers Use Two’s Complement? The Story Behind Binary Number Representation
FunTester
FunTester
Nov 25, 2020 · Fundamentals

Why Math.abs(Integer.MIN_VALUE) Returns a Negative Value in Java

The article explains that Math.abs() can return a negative result when applied to Integer.MIN_VALUE because the absolute value exceeds the int range, detailing the two's‑complement representation, overflow behavior, and how the JLS defines the operation.

buginteger-min-valuemath.abs
0 likes · 4 min read
Why Math.abs(Integer.MIN_VALUE) Returns a Negative Value in Java
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Aug 25, 2020 · Fundamentals

Understanding Bitwise Operations in Java: Uses, Representations, and the Seven Operators

This article explains the purpose and practical benefits of bitwise operations in Java, describes signed number representations (sign‑magnitude, ones' complement, two's complement), shows how bits can optimize time and space, and details the seven common bitwise operators with examples and a reference table.

algorithm fundamentalsbinary representationbitwise operations
0 likes · 13 min read
Understanding Bitwise Operations in Java: Uses, Representations, and the Seven Operators
Programmer DD
Programmer DD
Jan 18, 2019 · Fundamentals

Master Java Bitwise Operations: From Binary Basics to Advanced Tricks

This tutorial explains Java's signed two's complement representation, demonstrates how to output binary strings, covers all bitwise operators (AND, OR, XOR, NOT, shifts), clarifies original/one's/complement forms, shows overflow handling, unsigned tricks with masking, and teaches packing multiple boolean flags into a single byte for efficient storage.

Binarybit operationsbitwise
0 likes · 18 min read
Master Java Bitwise Operations: From Binary Basics to Advanced Tricks