home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / hp48 / 4301 < prev    next >
Encoding:
Text File  |  1992-08-18  |  1.3 KB  |  37 lines

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