mxcl/homebrew — Issue #10484: Python 2.7.2: Decimal division error when built with clang
Author: claymation
Created: 2012-02-26 01:20:10+00:00
State: open

Division operations fail when using the Decimal data type in the homebrew build of Python 2.7.2:

> $ /usr/local/bin/python -c 'from decimal import Decimal; print Decimal(4) / Decimal(2)'
> 1.5772784113028694016E-10

By comparison with the system python:

> $ /usr/bin/python -c 'from decimal import Decimal; print Decimal(4) / Decimal(2)'
> 2

Apparently this is related to a problem building under clang:

http://stackoverflow.com/questions/7590137/dividing-decimals-yields-invalid-results-in-python-2-5-to-2-7