json-rust icon indicating copy to clipboard operation
json-rust copied to clipboard

Arithmetic for Number (and JsonValue)?

Open maciejhirsz opened this issue 8 years ago • 1 comments

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) ?

maciejhirsz avatar Jul 26 '16 08:07 maciejhirsz

Required for #66

maciejhirsz avatar Oct 13 '16 16:10 maciejhirsz