Tagged articles
Long
12 articles · Page 1 of 1
The article surveys ten community‑sourced approaches to representing monetary values in Java, weighing Long, BigDecimal, String, Protobuf, custom types, and other quirky suggestions, and explains the reasoning each contributor gives for their preferred data type.
JavaLongMonetary Precision
0 likes · 4 min read

The article surveys ten community‑suggested approaches for representing monetary values in Java—ranging from using Long, BigDecimal, String, Protobuf, custom types, to following leadership or AI advice—highlighting each option’s rationale and trade‑offs such as precision, range, performance, and maintainability.
JavaLongMonetary
0 likes · 4 min read


java1234Jul 18, 2026 · Backend Development
The article explains why floating‑point types are unsafe for monetary values, compares the Long‑in‑cents and BigDecimal‑in‑yuan approaches, lists their advantages and drawbacks, and provides concrete Java code, database schemas, layer‑boundary conversion patterns, and common pitfalls.
BackendFinancialJava
0 likes · 8 min read

A developer asks whether monetary amounts should be stored as Long or BigDecimal, and the article compiles ten varied community suggestions—ranging from using Long, BigDecimal, String, custom types, Protobuf, leadership directives, AI answers, frugal choices, to whimsical ideas—each with brief explanations and illustrative images.
JavaLongMonetary Values
0 likes · 4 min read

This article compares ten community‑sourced approaches for representing monetary values in Java, explaining when a simple Long, a precise BigDecimal, a String, custom wrappers, Protobuf tricks, leadership directives, AI assistance, or even minimal integer types are appropriate, and why each choice matters.
JavaLongMonetary
0 likes · 3 min read

The article explores the common dilemma of choosing between Long and BigDecimal for monetary values, summarizing ten distinct community suggestions ranging from using Long, BigDecimal, String, Protobuf, custom types, leadership advice, AI assistance, to minimalist integer approaches.
JavaLongbigdecimal
0 likes · 4 min read

A developer team debates whether to store monetary amounts as BigDecimal or long, discussing experience‑based preferences, past incidents, and asking the community for real‑world pitfalls of each approach.
BackendJavaLong
0 likes · 2 min read

The article examines the long‑standing debate over using Long or BigDecimal to represent monetary amounts, presents ten community‑sourced approaches with visual illustrations, analyzes the underlying precision problem, and concludes with a recommendation favoring BigDecimal for accurate financial calculations.
Financial ComputingJavaLong
0 likes · 9 min read

When generating large IDs using Snowflake-like algorithms, Java's 64‑bit long values exceed JavaScript's safe integer range, causing display errors; the article explains how to resolve this by serializing Long values as strings in Spring Boot using Jackson's ToStringSerializer, both via configuration and annotations.
ID SerializationJacksonJava
0 likes · 2 min read

Through a multithreaded test program, this article explores whether Java’s 64‑bit long and double types are accessed atomically on 32‑bit and 64‑bit JVMs, explains the JVM memory model rules, and shows how volatility and hardware affect atomicity.
ConcurrencyJVMJava
0 likes · 10 min read

This article explains the concept of absolute value, demonstrates Java's Math.abs overloads for different primitive types, illustrates a common hashing use‑case that can fail when Integer.MIN_VALUE is processed, and shows how casting to long resolves the overflow problem.
Longabsolute-valuehashCode
0 likes · 5 min read

This article explains why the new Java development manual forbids returning large Long values as JSON, explores the IEEE754 double‑precision limits that cause JavaScript Number precision loss, and provides practical solutions such as converting Longs to strings to avoid silent data corruption.
BackendIEEE754JSON
0 likes · 13 min read
