Tagged articles
float
17 articles · Page 1 of 1
This article explores floating-point precision issues in HarmonyOS development, demonstrating how float's 7-digit limit corrupts sensor data, why double increases memory 30% and fails in Native calls, and why BigDecimal kills real-time performance, concluding with a scenario-based selection strategy and validation mechanism.
HarmonyOSNative interfacebigdecimal
0 likes · 10 min read

This article explains Java's primitive data types—including integer, floating‑point, character, and boolean types—covers their memory sizes, value ranges, literal syntax, automatic and explicit type conversions, and provides concrete code examples and tables for reference.
IntegerJavaType Conversion
0 likes · 16 min read

This tutorial explains why type conversion is needed in Python, describes the int(), str(), float() and bool() functions with their parameters, and provides a concrete example showing how to turn user input from a string into an integer for arithmetic.
PythonTutorialType Conversion
0 likes · 4 min read

This article explains how to reconstruct a 32‑bit floating‑point value from four serial bytes in embedded C by using a union or struct overlay, demonstrates the code, shows the resulting little‑endian byte order, and provides a simple function to detect system endianness.
C++Serial CommunicationUNION
0 likes · 5 min read

This guide explains how PHP’s built‑in floatval function converts integers, strings, booleans, and arrays to floating‑point numbers, provides syntax details, multiple code examples, and important usage notes for reliable numeric handling.
PHPProgramming TutorialType Conversion
0 likes · 4 min read

This guide explains PHP’s is_float() function, covering its syntax, how it determines whether a variable is a floating‑point number, including return values, example outputs, and a note on using is_numeric() for broader numeric checks, helping developers avoid type‑related errors.
PHPfloatis_float
0 likes · 4 min read

This guide explains PHP’s is_float() function, showing how it determines whether a variable is a float, with clear code examples for simple variables and arrays, and highlights important nuances such as strict type checking and automatic conversion behavior.
PHPfloatis_float
0 likes · 5 min read

This article explains PHP’s built‑in is_float() function, demonstrating how it determines whether a variable is a floating‑point number, with simple and complex code examples, and discusses its strict type checking behavior and practical usage scenarios in backend development.
PHPfloatis_float
0 likes · 4 min read

This article explains PHP's ceil() function, detailing its syntax, parameters, and behavior for rounding numbers upward, and provides three clear code examples demonstrating its use with positive, negative, and integer values, along with the expected output for each case.
BackendMathPHP
0 likes · 3 min read

This article explains how to use Python's built‑in casting functions—int(), float(), str(), bool(), list(), tuple(), set() and dict()—to convert between numeric, string, boolean, sequence, and mapping types, providing clear code examples for each conversion scenario.
ListPythonbool
0 likes · 14 min read

This article explains why using a float to store monetary values leads to precision errors by examining binary representation, demonstrates the problem with a Java example, and recommends using integer or decimal types for accurate financial calculations.
DecimalJavaMoney
0 likes · 7 min read

This article explains why Java's Float values 0.0 and -0.0 have different hashCode results, how that affects their use as Map keys, and demonstrates the underlying IEEE‑754 representation and related debugging steps with concrete code examples.
IEEE754floathashCode
0 likes · 9 min read

This article explains how Java's Float hashCode treats 0.0 and -0.0 as distinct values, causing unexpected behavior when using floating‑point numbers as HashMap keys, and shows how to debug, reproduce, and avoid the issue by using alternative representations.
HashMapIEEE754float
0 likes · 10 min read

This article introduces Python’s fundamental data types—including integers, floats, booleans, and strings—explaining their characteristics, representation formats, common pitfalls such as floating‑point precision, and provides concise code examples illustrating each type’s usage in Python.
Stringboolfloat
0 likes · 3 min read

This guide explains PHP’s is_finite() function, its purpose, accepted parameter, return behavior, and provides a clear code example showing how to determine whether a floating‑point number is a finite value on the current platform.
BackendPHPfloat
0 likes · 2 min read

The article explains PHP's floor() function, describing its signature, parameter, return type, and provides example code showing how it truncates floating‑point numbers to the nearest lower integer, with sample outputs for positive and negative values.
BackendFunctionRounding
0 likes · 2 min read

The article explains the precision loss caused by using float for monetary values, demonstrates the binary representation of floating‑point numbers, and recommends using integer (cents) or MySQL decimal types to store money accurately, providing Java and SQL examples.
DecimalMoneydatabase
0 likes · 8 min read
