?
=?ISO-8859-2?Q?Milan_=C8erm=E1k?=
Hi all,
I'm about to write an arithmetics object library. It should contain
classes like ShortInteger (for 32-bit longs), Double and Float as
standard numeric type wrappers and LongInteger (really long numbers, not
only 64-bit) and Fraction (to express high precission).
All these classes may inherit from abstract class Number.
I got stuck on following point. I'm not sure how to implement basic
arithmetic operations. What the result type should be? (I don't mean
method return type, but specific operation result type, ie. 1.0 + 1.0 =
<double> 2.0.)
And one more question. If I put the code into a library, it be possible
to extend it? For example some one may want to implement Complex.
Any ideas?
Thanks,
Milan Cermak (Czech Republic)
I'm about to write an arithmetics object library. It should contain
classes like ShortInteger (for 32-bit longs), Double and Float as
standard numeric type wrappers and LongInteger (really long numbers, not
only 64-bit) and Fraction (to express high precission).
All these classes may inherit from abstract class Number.
I got stuck on following point. I'm not sure how to implement basic
arithmetic operations. What the result type should be? (I don't mean
method return type, but specific operation result type, ie. 1.0 + 1.0 =
<double> 2.0.)
And one more question. If I put the code into a library, it be possible
to extend it? For example some one may want to implement Complex.
Any ideas?
Thanks,
Milan Cermak (Czech Republic)