Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Price Basic Math functions #66

Open
Florian-S-A-W opened this issue Jun 26, 2023 · 0 comments
Open

Price Basic Math functions #66

Florian-S-A-W opened this issue Jun 26, 2023 · 0 comments

Comments

@Florian-S-A-W
Copy link

The Price class inherits add(), subtract() and divide() from the Fraction class, as well as comparison functions (LT, GT,...).
All of these functions therefore take Fraction as the second argument.

Only the multiply function is overwritten and accepts Price<TQuote, TOtherQuote> as a second argument.

This is nearly the exact opposite behaviour of what I would intuitively expect. It makes sense to multiply or divide a Price with a Fraction, BigIntish or even Percent, but it makes no sense to add, divide or compare two totally different Price Objects and get a Fraction object in return.
What is the reason for this design decision?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant