From: John Baylor Date: 2006-07-01T09:59:06+09:00 Subject: Re: [QUIZ] C-Style Ints (#85) ------=_Part_5712_15267534.1151704556683 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline It certainly looks like two classes to me (and that is what my earlier test harness assumes). The only way to do it with a single class would be to somehow tell it whether it was signed or unsigned. My plan is to implement one of them and then use it or extend it from the other one. If I didn't have this darn job I would be doing the quiz right now... :-) JB On 6/30/06, Josef 'Jupp' SCHUGT wrote: > > Hi! > > At Fri, 30 Jun 2006 22:47:46 +0900, Ruby Quiz wrote: > > > Write a class that can represent a signed or unsigned number with an > > arbitrary number of bits. > > : > > irb(main):001:0> n = UnsignedFixedWidthInt.new(0xFF, 8) > > : > > irb(main):001:0> n = SignedFixedWidthInt.new(0x01, 8) > > Does "write a class" imply that UnsignedFixedWidthInt and > SignedFixedWidthInt are two different names for the just one class? > > Josef 'Jupp' Schugt > > ------=_Part_5712_15267534.1151704556683--