[comp.lang.c++] Want to make sign_mag and long sign_mag class, can I?

ar12@prism.gatech.EDU (REGISTER,ANDREW H) (03/28/91)

I want to build a class to do signed-magnitude arithmetic.  (Yes I know I could do
this with int and long int.)  I want to make a class called sign_mag that would be
a 16 bit sign-magnitude number.  Then I also want another class that would be a 
32 bit sign-magnitude number.  I would like to be able to specify this like:

sign_mag  A16BitSM;
long sign_mag A32BitSM;

I cannot figure out if this is even possible much less how to do it.

I also want to override -, +, *, /, to work with both classes and get the proper
type casting.  (sign_mag is converted to long sign_mag before being added to a
long sign_mag)

Any help or pointers in the right direction will be appreciated!

Toodles
Andy

-- 
Andy Register  Internet: ar12@prism.gatech.edu   Bitnet: aregiste@gtri01.bitnet

-- Sometimes the Bears Win, Sometimes the Bulls Win --
    -------- But the Pigs *Always* Lose --------              (author unknown)