(value)
| 308 | maxcontext.clamp = 0 |
| 309 | |
| 310 | def RestrictedDecimal(value): |
| 311 | maxcontext.traps = copy(context.p.traps) |
| 312 | maxcontext.clear_flags() |
| 313 | if isinstance(value, str): |
| 314 | value = value.strip() |
| 315 | dec = maxcontext.create_decimal(value) |
| 316 | if maxcontext.flags[P.Inexact] or \ |
| 317 | maxcontext.flags[P.Rounded] or \ |
| 318 | maxcontext.flags[P.Clamped] or \ |
| 319 | maxcontext.flags[P.InvalidOperation]: |
| 320 | return context.p._raise_error(P.InvalidOperation) |
| 321 | if maxcontext.flags[P.FloatOperation]: |
| 322 | context.p.flags[P.FloatOperation] = True |
| 323 | return dec |
| 324 | |
| 325 | |
| 326 | # ====================================================================== |
no test coverage detected
searching dependent graphs…