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

Price Basic Math functions #66

@Florian-S-A-W

Description

@Florian-S-A-W

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions