Tag

Decimal

0 views collected around this technical thread.

Test Development Learning Exchange
Test Development Learning Exchange
Sep 4, 2024 · Fundamentals

How to Convert decimal.Decimal to float in Various Python Data Structures

This tutorial demonstrates multiple ways to transform Python decimal.Decimal objects into native float values across different data structures such as single variables, lists, dictionaries, nested collections, pandas DataFrames, JSON strings, tuples, and sets, while highlighting precision considerations.

DecimalJSONPython
0 likes · 7 min read
How to Convert decimal.Decimal to float in Various Python Data Structures
Test Development Learning Exchange
Test Development Learning Exchange
Sep 3, 2024 · Fundamentals

Using Python's decimal Module for Precise Decimal Arithmetic

This article introduces Python's decimal module, explains its importance for high‑precision calculations, and provides step‑by‑step examples covering basic creation, arithmetic operations, precision control, rounding, formatting, division, comparisons, advanced contexts, and custom rounding modes.

ArithmeticDecimalTutorial
0 likes · 5 min read
Using Python's decimal Module for Precise Decimal Arithmetic
Python Programming Learning Circle
Python Programming Learning Circle
Jul 8, 2024 · Fundamentals

Python Variable Usage, Naming Conventions, and Common Operations

This article teaches Python developers how to write cleaner, more elegant code by mastering variable unpacking, underscore placeholders, type annotations, PEP 8 naming rules, numeric literals, floating‑point precision handling with Decimal, boolean arithmetic tricks, and a wide range of string manipulation techniques, all illustrated with practical code examples.

DecimalPythonType Annotations
0 likes · 10 min read
Python Variable Usage, Naming Conventions, and Common Operations
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
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
Jul 13, 2023 · Backend Development

How to Keep Two Decimal Places in PHP Using round(), sprintf() and number_format()

This tutorial demonstrates three PHP techniques—round(), sprintf(), and number_format()—to format numbers with exactly two decimal places, explains the number_format() function syntax and parameters, and provides practical examples for displaying product prices with customizable decimal points and thousand separators.

DecimalPHPbackend
0 likes · 5 min read
How to Keep Two Decimal Places in PHP Using round(), sprintf() and number_format()
Python Programming Learning Circle
Python Programming Learning Circle
May 14, 2022 · Fundamentals

Advanced Number, Date, and Formatting Techniques in Python

This article explains how to perform precise numeric operations, format numbers, convert between bases, handle complex numbers, work with infinities and NaN, use fractions, manipulate large arrays with NumPy, generate random data, and manage dates, times, and time zones in Python.

Complex NumbersDateTimeDecimal
0 likes · 24 min read
Advanced Number, Date, and Formatting Techniques in Python
php中文网 Courses
php中文网 Courses
Apr 23, 2021 · Backend Development

Converting Decimal Numbers to Binary in PHP with decbin()

This article explains how to use PHP's built‑in decbin() function to convert decimal integers into their binary string representation, covering the function syntax, parameter details, return limits, and providing a clear code example with expected output.

Decimalbinaryconversion
0 likes · 1 min read
Converting Decimal Numbers to Binary in PHP with decbin()
Laravel Tech Community
Laravel Tech Community
Jan 13, 2021 · Backend Development

PHP bindec() Function: Converting Binary Strings to Decimal

This article explains how the PHP bindec() function converts binary strings to their decimal equivalents, describes its parameters and return values, and provides example code with expected output for developers working on backend applications.

DecimalPHPTutorial
0 likes · 2 min read
PHP bindec() Function: Converting Binary Strings to Decimal
Architecture Digest
Architecture Digest
May 29, 2020 · Fundamentals

Why Float Should Not Be Used for Storing Monetary Values and Better Alternatives

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.

DatabaseDecimalJava
0 likes · 8 min read
Why Float Should Not Be Used for Storing Monetary Values and Better Alternatives