Tag

Floating Point

1 views collected around this technical thread.

DeWu Technology
DeWu Technology
Jun 4, 2025 · Backend Development

Performance Optimization of Floating‑Point Conversion and GC Tuning in Java Backend Services

This article details how replacing Java's native double parsing with the Ryu and FastFloat algorithms, alongside JVM GC tuning, dramatically reduces CPU usage and latency in backend services, offering practical code examples, benchmark results, and actionable optimization strategies.

FastFloatFloating PointGC
0 likes · 15 min read
Performance Optimization of Floating‑Point Conversion and GC Tuning in Java Backend Services
Lobster Programming
Lobster Programming
May 30, 2025 · Fundamentals

Why Floating‑Point Errors Hurt Financial Calculations and How BigDecimal Solves Them

Floating‑point numbers cannot precisely represent many decimal values, leading to cumulative errors in financial calculations, so Java’s BigDecimal class is recommended for high‑precision arithmetic to avoid such inaccuracies and ensure reliable monetary computations.

BigDecimalFloating PointJava
0 likes · 2 min read
Why Floating‑Point Errors Hurt Financial Calculations and How BigDecimal Solves Them
Code Mala Tang
Code Mala Tang
Feb 25, 2025 · Fundamentals

Why Does 0.1 + 0.2 Not Equal 0.3 in Python? Understanding Floating‑Point Precision

Python’s unexpected 0.1 + 0.2 = 0.30000000000000004 result stems from binary floating‑point representation limits defined by the IEEE 754 standard, and the article explains this issue, rounding modes, and practical solutions such as the decimal module, fractions, math.isclose, and high‑precision NumPy types.

Floating PointIEEE 754NumPy
0 likes · 9 min read
Why Does 0.1 + 0.2 Not Equal 0.3 in Python? Understanding Floating‑Point Precision
macrozheng
macrozheng
Feb 25, 2025 · Fundamentals

Why double Is Inaccurate and How to Use BigDecimal Correctly in Java

This article explains why double precision numbers cannot represent many decimal values exactly, how BigDecimal achieves precise arithmetic through unscaled values and scale, and the proper ways to construct BigDecimal objects to avoid precision loss in Java applications.

BigDecimalFloating PointJava
0 likes · 10 min read
Why double Is Inaccurate and How to Use BigDecimal Correctly in Java
php中文网 Courses
php中文网 Courses
Jan 13, 2025 · Backend Development

Using PHP is_float() to Detect Floating‑Point Numbers

This article explains PHP's is_float() function, covering its syntax, behavior, practical usage, and provides multiple code examples demonstrating how to detect floating‑point numbers and combine the check with conditional logic in real‑world applications.

Floating PointPHPbackend development
0 likes · 5 min read
Using PHP is_float() to Detect Floating‑Point Numbers
IT Services Circle
IT Services Circle
Jun 14, 2024 · Fundamentals

Understanding Floating‑Point Precision and Common Pitfalls in Java

The article explains why comparing floating‑point numbers with == in Java often yields unexpected results, describes the IEEE‑754 representation of float and double, demonstrates common pitfalls through code examples, and provides step‑by‑step methods for converting decimal fractions to binary.

Floating PointIEEE 754Java
0 likes · 10 min read
Understanding Floating‑Point Precision and Common Pitfalls in Java
IT Services Circle
IT Services Circle
Dec 23, 2023 · Fundamentals

Understanding Floating‑Point Precision Issues in Python and How to Handle Them

The article explains why Python’s 0.1 + 0.2 does not equal 0.3 due to binary representation limits, discusses the impact of tiny rounding errors on equality checks, and recommends using tolerance thresholds or the Decimal module (initialized with strings) for accurate numeric computations, especially in finance.

DecimalFloating PointNumerical Comparison
0 likes · 3 min read
Understanding Floating‑Point Precision Issues in Python and How to Handle Them
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Nov 13, 2023 · Fundamentals

Mastering Java’s BigDecimal: Avoid Precision Pitfalls and Write Accurate Calculations

This article explains why Java's BigDecimal is essential for high‑precision arithmetic, outlines common use cases such as finance and scientific computing, highlights typical pitfalls with floating‑point numbers, and provides practical code examples and best‑practice tips for correct usage.

ArithmeticBigDecimalFloating Point
0 likes · 8 min read
Mastering Java’s BigDecimal: Avoid Precision Pitfalls and Write Accurate Calculations
360 Quality & Efficiency
360 Quality & Efficiency
Sep 1, 2023 · Fundamentals

Understanding Floating-Point Representation, Issues, and Solutions

This article explains how floating‑point numbers are represented in computers using IEEE‑754, illustrates conversion from decimal to binary, describes single‑ and double‑precision formats, outlines common precision, rounding, comparison, overflow, and associativity problems, and presents practical solutions such as high‑precision decimal types, integer scaling, and specialized libraries.

DecimalFloating PointPrecision
0 likes · 9 min read
Understanding Floating-Point Representation, Issues, and Solutions
php中文网 Courses
php中文网 Courses
Aug 15, 2023 · Backend Development

Using PHP fmod() Function to Compute Floating‑Point Remainder

The article explains PHP's fmod() function for calculating the remainder of two floating‑point numbers, describes its syntax and parameter roles, provides multiple code examples—including handling of zero divisors and negative values—and notes that it returns a float or NAN when appropriate.

Floating PointPHPbackend
0 likes · 4 min read
Using PHP fmod() Function to Compute Floating‑Point Remainder
php中文网 Courses
php中文网 Courses
Aug 12, 2023 · Backend Development

Using PHP's abs() Function: Syntax, Examples, and Handling Floating‑Point Precision

This article explains PHP's abs() absolute‑value function, covering its syntax, basic integer and floating‑point examples, precision issues with very small numbers, and how to combine it with round() to obtain accurate results, while noting its limitation to numeric types.

Floating PointTutorialabs
0 likes · 4 min read
Using PHP's abs() Function: Syntax, Examples, and Handling Floating‑Point Precision
Sanyou's Java Diary
Sanyou's Java Diary
Dec 5, 2022 · Backend Development

Avoid Costly Bugs: Mastering BigDecimal Pitfalls in Java

This article explains why using Java's BigDecimal is essential for precise financial calculations, outlines four common pitfalls—including floating-point errors, equality comparison, scale handling, and string conversion—and provides practical best-practice solutions with code examples and rounding mode guidance.

BigDecimalFloating PointJava
0 likes · 14 min read
Avoid Costly Bugs: Mastering BigDecimal Pitfalls in Java
IT Services Circle
IT Services Circle
Aug 30, 2022 · Backend Development

Understanding Java BigDecimal: Solving Floating‑Point Precision Problems

This article explains why floating‑point numbers lose precision in binary representation, demonstrates the issue with Java float examples, and shows how to use the BigDecimal class—including creation, arithmetic operations, scaling, and proper equality comparison—to achieve exact decimal calculations in Java applications.

ArithmeticBigDecimalComparison
0 likes · 8 min read
Understanding Java BigDecimal: Solving Floating‑Point Precision Problems
Cognitive Technology Team
Cognitive Technology Team
Jul 30, 2022 · Fundamentals

Common Pitfalls of java.math.BigDecimal and How to Avoid Them

This article explains several common mistakes when using Java's BigDecimal—such as constructing it with a double, using valueOf, relying on equals for comparison, and misusing round—and provides correct alternatives like string constructors, valueOf with proper precision, compareTo, and setScale for reliable arithmetic.

BigDecimalFloating PointJava
0 likes · 6 min read
Common Pitfalls of java.math.BigDecimal and How to Avoid Them
Java Captain
Java Captain
Jun 7, 2022 · Fundamentals

Understanding BigDecimal Precision Issues in Monetary Calculations and a Utility Class for Accurate Operations

This article explains why using floating‑point types with BigDecimal can cause precision loss in financial calculations, demonstrates the problem with sample code, analyzes the underlying double‑to‑long conversion, and provides a reusable Java utility class to perform accurate arithmetic with BigDecimal.

BigDecimalFloating PointJava
0 likes · 8 min read
Understanding BigDecimal Precision Issues in Monetary Calculations and a Utility Class for Accurate Operations
Top Architect
Top Architect
Jul 5, 2021 · Databases

MySQL Implicit Type Conversion Leads to Unexpected Query Results

This article explains how MySQL implicitly converts mismatched column types—such as comparing a VARCHAR column with a numeric literal—into floating‑point numbers, causing seemingly equal values to match, losing index usage, and potentially producing incorrect query results.

Floating PointMySQLType Conversion
0 likes · 7 min read
MySQL Implicit Type Conversion Leads to Unexpected Query Results
php中文网 Courses
php中文网 Courses
May 14, 2021 · Backend Development

Handling Floating-Point Precision in PHP: Common Issues and Solutions with bcmath

This article explains PHP floating-point precision issues, demonstrates common arithmetic errors, and shows how to use the bcmath extension and various rounding functions such as floor, ceil, round, and number_format to achieve accurate numeric calculations in backend development.

Floating PointPrecisionbackend
0 likes · 6 min read
Handling Floating-Point Precision in PHP: Common Issues and Solutions with bcmath
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Feb 4, 2021 · Fundamentals

How to Correctly Create and Use BigDecimal in Java for Precise Calculations

BigDecimal provides precise arithmetic in Java, but its correct usage requires understanding its internal unscaled value and scale, avoiding the inaccurate BigDecimal(double) constructor, and preferring String or valueOf methods to accurately represent decimal numbers such as 0.1 in financial and e‑commerce applications.

BigDecimalFloating PointJava
0 likes · 9 min read
How to Correctly Create and Use BigDecimal in Java for Precise Calculations
Beike Product & Technology
Beike Product & Technology
Oct 14, 2020 · Fundamentals

Understanding IEEE‑754 Floating‑Point Precision Issues in JavaScript

This article explains why JavaScript’s Number type, which follows the IEEE‑754 double‑precision standard, can produce unexpected results such as 0.1 + 0.2 = 0.30000000000000004, demonstrates the binary representation of numbers like 2.5 and 0.1, and offers practical techniques and libraries to mitigate floating‑point errors.

Floating PointJavaScriptPrecision
0 likes · 8 min read
Understanding IEEE‑754 Floating‑Point Precision Issues in JavaScript
Selected Java Interview Questions
Selected Java Interview Questions
May 30, 2020 · Backend Development

Understanding Precision Loss in Java's BigDecimal and Proper Usage

The article explains why floating‑point arithmetic in Java loses precision, demonstrates how even BigDecimal can suffer when constructed from double values, and shows the correct practice of using the BigDecimal(String) constructor together with utility methods to perform accurate monetary calculations.

BigDecimalFloating PointJava
0 likes · 9 min read
Understanding Precision Loss in Java's BigDecimal and Proper Usage