Tag

Long

1 views collected around this technical thread.

Architect's Guide
Architect's Guide
Nov 26, 2024 · Backend Development

BigDecimal vs Long for Monetary Values: Pros, Cons, and Common Pitfalls

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.

BigDecimalJavaLong
0 likes · 2 min read
BigDecimal vs Long for Monetary Values: Pros, Cons, and Common Pitfalls
Cognitive Technology Team
Cognitive Technology Team
Aug 12, 2022 · Backend Development

Handling Large Integer IDs in Java and JavaScript: Preventing Precision Loss with Jackson Configuration

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
Handling Large Integer IDs in Java and JavaScript: Preventing Precision Loss with Jackson Configuration
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Jul 20, 2021 · Fundamentals

Understanding Java Math.abs and Handling Integer.MIN_VALUE Edge Cases

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.

HashCodeLongabsolute-value
0 likes · 5 min read
Understanding Java Math.abs and Handling Integer.MIN_VALUE Edge Cases