Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!sdd.hp.com!spool.mu.edu!uunet!zephyr.ens.tek.com!uw-beaver!milton!nntp.uoregon.edu!nntp.uoregon.edu!stevev From: stevev@greylady.uoregon.edu (Steve VanDevender) Newsgroups: comp.sys.handhelds Subject: Re: What's the difference? Message-ID: Date: 29 Jun 91 07:59:30 GMT References: <1991Jun26.180439.6856@soph.cs.ubc.ca> <1991Jun28.223713.6352@corpane.uucp> Sender: news@ns.uoregon.edu Organization: University of Oregon Chemistry Stores Lines: 44 In-Reply-To: herman@corpane.uucp's message of 28 Jun 91 22:37:13 GMT >However, the HP48 Programmer's Reference Manual states that SAME and == >are supposed to work the same for any comparison that does not include >algebraics or a name. (pgs 323 and 447). In fact SAME said it is >"identical in effect to ==" except for those two types. Despite what the Programmer's Reference Manual or the Owner's Manual (volume II, p. 492 says basically the same thing you cited), it is clear that SAME compares the binary representations of binary integers and not just their values. I have just done some double-checking and seen that when you enter a binary integer, it is placed on the stack as a 16-nibble binary integer. However, if the word size is 60 or less then the result of a binary integer operation is a binary integer with length CEIL(RCWS / 4). SAME does _not_ compare binary integers for value equality but instead compares them for binary equality--they must have the same length and the same value to compare equal. ==, however, does compare binary integers just for value equality and is therefore the operator that has the effect the original poster was looking for. You can try this at home, like I did: 16 STWS #8000h SRB #80 SAME produces the result 0 LASTARG == produces the result 1 You can replace the 16 with any number 60 or less and you will get the same results. If the number is greater than 60 then results of binary integer operations will produce 16-nibble binary integers and the second binary integer entered will compare the same with SAME or == because both are 16-nibble binary integers. > Harry Herman > herman@corpane Shouldn't that be "herman@corpane.uucp" or "corpane!herman" or something like that? -- Steve VanDevender stevev@greylady.uoregon.edu "Bipedalism--an unrecognized disease affecting over 99% of the population. Symptoms include lack of traffic sense, slow rate of travel, and the classic, easily recognized behavior known as walking."