This pull request will merge in the handling of DecimalArithmetic.
Decimal (base10 numbers) arithmetic is different to floating point (base2 numbers) arithmetic, and in use cases that involve money, it's imperative that the user is given the option to have any arithmetic calculations made using fixed-point decimal numbers rather than floating point.
DecimalArithmetic is added and used strictly as an optional use case (not added to the full() language set). It is not used unless one specifies its use.
Use can be specified by calling the DecimalArithmetic language directly and evaluation expressions against that language. DecimalArithmetic overrides the default handling for scanner.Int and scanner.Float to use parseDecimal and then all arithmetic is run against the decimal.Decimal from the widely used shopspring/decimal repository.
This pull request will merge in the handling of DecimalArithmetic.
Decimal (base10 numbers) arithmetic is different to floating point (base2 numbers) arithmetic, and in use cases that involve money, it's imperative that the user is given the option to have any arithmetic calculations made using fixed-point decimal numbers rather than floating point.
DecimalArithmetic
is added and used strictly as an optional use case (not added to thefull()
language set). It is not used unless one specifies its use.Use can be specified by calling the
DecimalArithmetic
language directly and evaluation expressions against that language.DecimalArithmetic
overrides the default handling forscanner.Int
andscanner.Float
to useparseDecimal
and then all arithmetic is run against thedecimal.Decimal
from the widely used shopspring/decimal repository.Tests and Benchmark Tests have been added.
This pull request fixes #70.