You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like there be an option like parser = BaseArithmeticParser(numerical_types=[int, Decimal, complex]) where if numerical_types=None it would default to the value numerical_types=[int, float, complex] so that when I'm dealing with monetary values I can be confident that the answer IS EXACT, not really super close.
The text was updated successfully, but these errors were encountered:
Well it took me a while to get around to this, but I did put some time into it, and I think I have a working version now. Rather than have you poke around with the internal numerical_types variable, I've added an optional use_decimal Boolean argument to the BaseArithmeticParser class initializer - when set to True, the internal math and resulting values will be Decimal objects, not floats. Works for common math operations, but complex results and trig functions are not supported in this mode.
I'd like there be an option like
parser = BaseArithmeticParser(numerical_types=[int, Decimal, complex])
where ifnumerical_types=None
it would default to the valuenumerical_types=[int, float, complex]
so that when I'm dealing with monetary values I can be confident that the answer IS EXACT, not really super close.The text was updated successfully, but these errors were encountered: