Message 104306 - Python tracker (original) (raw)

(1) Perhaps I missed the relevant part in the spec, so I had to check what decNumber does: In the default context, clamp is 0, in the extended contexts, it is 1. So Python's ExtendedContext should indeed set _clamp to 1.

(2) I agree about the importance of the formats, and I think they should be explicitly selectable like here:

http://java.sun.com/j2se/1.5.0/docs/api/java/math/class-use/MathContext.html

The current ExtendedContext is a bit of a vague concept, since it should be exactly one of DECIMAL32, DECIMAL64 or DECIMAL128. And none of these has prec=9.