home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.hp48
- Path: sparky!uunet!mcsun!news.funet.fi!funic!nntp.hut.fi!nntp.hut.fi!mheiskan
- From: mheiskan@hut.fi (Mika Heiskanen)
- Subject: Re: base conversion?
- In-Reply-To: anderson@Apple.COM's message of 18 Aug 92 22:14:56 GMT
- Message-ID: <MHEISKAN.92Aug19022024@vipunen.hut.fi>
- Sender: usenet@nntp.hut.fi (Usenet pseudouser id)
- Nntp-Posting-Host: vipunen.hut.fi
- Reply-To: mheiskan@.vipunen.hut.fi
- Organization: Helsinki University of Technology - Finland
- References: <71354@apple.Apple.COM>
- Date: 19 Aug 92 02:20:24
- Lines: 22
-
- In article <71354@apple.Apple.COM> anderson@Apple.COM (Clark Anderson) writes:
-
- > Something appears to be odd about the base
- > conversion function with the 48...
- >
- > If I enter 1 as a binary number, then negate
- > it, I get 1111 1111 1111 1111. OK, fine.
- > This is -1 in 2's complement.
- >
- > However, if I'm in decimal, enter a 1 and
- > negate it, I get 65535. This isn't -1 in
- > base 10 - in fact, it isn't even negative.
- > A negative number would start with a '9'.
- > The answer should be 99999.
- >
- > Is this a bug, or am I doing something wrong?
-
- Handling any binary integer is done in binary mode. Thus you get #1111...
- as result. You can think about it as binary math that has other display
- modes too (decimal, hex, octal).
- --
- --> mheiskan@vipunen.hut.fi
-