Dec-07-2021, 07:52 PM
(This post was last modified: Dec-07-2021, 07:54 PM by Yoriz.
Edit Reason: python tags
)
shouldn't this raise some kind of exception, like a
Decimal.UNDERFLOW
or something like that, new?lt2a/phil /home/phil 10> python3 Python 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from decimal import * >>> getcontext() Context(prec=28, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999, capitals=1, clamp=0, flags=[], traps=[InvalidOperation, DivisionByZero, Overflow]) >>> Decimal('1E999999')*Decimal('1E99') Traceback (most recent call last): File "<stdin>", line 1, in <module> decimal.Overflow: [<class 'decimal.Overflow'>] >>> Decimal('1E-999999')*Decimal('1E-99') Decimal('0E-1000026') >>> Decimal('1E-1000026') Decimal('1E-1000026') >>>it does not appear to be a representation issue, so i assume it is an operation issue.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.