Skip to content Skip to sidebar Skip to footer
Showing posts with the label Floating Accuracy

Floating Point Behavior In Python 2.6 Vs 2.7

So I break out the Python 2.6 interpreter and I get this: Python 2.6.6 (r266:84292, Nov 22 2013, 12… Read more Floating Point Behavior In Python 2.6 Vs 2.7

Exhausting Floating Point Precision In A (seemingly) Infinite Loop

I've got the following Python script: x = 300000000.0 while (x Solution 1: When you initializ… Read more Exhausting Floating Point Precision In A (seemingly) Infinite Loop

Dividing And Multiplying Decimal Objects In Python

In the following code, both coeff1 and coeff2 are Decimal objects. When i check their type using ty… Read more Dividing And Multiplying Decimal Objects In Python

Is There A Way To Return A Fully Reduced Ratio When Calling .as_integer_ratio()?

I noticed something strange when calling .as_integer_ratio() on some floats. for example: (2.2).as_… Read more Is There A Way To Return A Fully Reduced Ratio When Calling .as_integer_ratio()?