Skip to content

Arithmetic for Number (and JsonValue)? #82

@maciejhirsz

Description

@maciejhirsz

It shouldn't be too difficult to implement all the arithmetic std::ops for Number, multiplication is already done but commented. Addition and subtraction needs to be able to level the exponent (much the same way PartialEq does it), which should also be abstracted somewhere.

Interesting question is whether or not the results should be normalized (e.g.: if mantissa 150 with exponent -2 should be lowered to mantissa 15 with exponent -1) ?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions