▼
Posts: 416
Threads: 78
Joined: Mar 2006
Hi everybody,
I don't know if anyone has already posted such topic, but here it is.
The HP-33S has the integer division. The algorithm, while used by
keyboard or into a program, returns correct results (or at least I
expect them to be correct), but not in EQN:
Operation INT÷ Rmdr IDIV(EQN) RMDR(EQN) INT÷(PRGM) RMDR(PRGM)
9 / 7 1 2 1 2 1 2
9 /-7 -2 -5 -1 -5 -2 -5
-9 /-7 1 -2 1 -2 1 -2
-9 / 7 -2 5 -1 5 -2 5
The previous results for IDIV are not number theory results, but
pretty divisions between reals turned to integer form. Notice
besides that RMDR return the same results.
The curious thing is that I used the same key (INT÷) on the calculator for the three cases.
Any more news?
-- Antonio
Edited to add PRGM case.
Edited: 1 Aug 2006, 10:18 a.m.
▼
Posts: 177
Threads: 12
Joined: Jan 1970
Wow! This looks similar to the negative HMS bug on the original 33s. Why the keypad entry, program and equation calls yield different results is a mystery.
It's too bad this wasn't discovered earlier so that Kinpo could have fixed it in later releases. I'm not effected by this bug as I don't use these functions but I wonder how many others are.
One work around is to take the absolute value of the Y and X registers before using the Integer and Remainder functions.
Regards,
John
▼
Posts: 1,153
Threads: 94
Joined: Mar 2006
Ouch!
I use 'em!
(Or, rather, used them ...)
▼
Posts: 416
Threads: 78
Joined: Mar 2006
Who will send an official remark to HP to force it fix this bug in later versions?
-- Antonio
Edited: 2 Aug 2006, 4:24 a.m.
▼
Posts: 177
Threads: 12
Joined: Jan 1970
Hi Antonio. I see three possibilities for reporting this:
o Call HP and report the bug.
o Review the bug with HP at HHC 2006.
o Does anyone maintain a database for 33s bugs (ie. bugzilla, etc.)? If so, that's another option.
Did these functions exist in the 32s / 32sii or are they new in the 33s? What other functions still need to be fully tested?
Regards,
John
▼
Posts: 2,448
Threads: 90
Joined: Jul 2005
This stupid integer crap was added with the 33s. There was a lengthy discussion of this business a couple years ago when the 33s first came out. Somewhererin the archives.
Posts: 32
Threads: 5
Joined: Jun 2008
Hello,
I can garentee you will get the message across (to Cyrille and his boss) if you bring this up at the Conference. For the Conference details see the two resources below.
Check out the 32nd “annual” Hewlett-Packard User Community,
HPUC, HP Handheld Conference, HHC, at:
http://holyjoe.net/hhc2006/
This year you will find a great deal of additional information
of interest to any serious HP handheld user. The website is updated
frequently. If you want the latest and fastest form of HPUC
information sign up (no charge) for the HHC List at:
http://lists.handheld.org/mailman/listinfo/hhc
You may post questions regarding the HHC and you may
provide your inputs as to what happens at the Conference. It
is your conference so make your views known by writing the
HHC Committee or posting on the above list.
Also check Eric Rechlin's web site at:
http://www.hpcalc.org/
While I didn't see a specific bug reporting section on the main page I thought that Eric accepted bug reports. I will check on this. Perhaps it is only for the high end machines.
X < > Y,
Richard J. Nelson
Posts: 4,587
Threads: 105
Joined: Jul 2005
Quote:
This looks similar to the negative HMS bug on the original 33s.
What was this bug? I just bought an 33s on ebay, s/n CNA 51501368. How can I check? Thanks in advance for some info!
Posts: 1,792
Threads: 62
Joined: Jan 2005
Antonio --
Another interesting find! To mix American slang with French, "You da beta-tester par excellence!"
Yes, indeed, this looks like a bug. The HP-33S manual states that IDIV is the Equation-mode name of the "INT/" function on the keyboard, but the should perform the same way. The answers for IDIV when the two operands are of opposite sign are plainly incorrect, because they are not consistent with the result from "Rmdr".
Discussion of MOD/RMD took place here a year or two ago. It is noteworthy that the RMD function on the HP-16C performs differently than the MOD function on the HP-41C*, HP-42S, and HP-28/48/49.
RMD is defined only for integer arguments. It always returns +/-2 for the four cases you provided, consistent with its built-in integer arithmetic. E.g., -7 goes into 9 only -1 times, with a remainder of 2. 9 ENTER -7 / in DEC (base-10 integer) mode yields -1 as the answer, with the carry bit set.
"Rmdr" on the HP-33S acts like MOD, which returns +/-5 when the operands are of opposite sign. It seems as though the rule requires that the MOD remainder and the divisor be of the same sign.
-- KS
▼
Posts: 177
Threads: 12
Joined: Jan 1970
I was able to duplicate the 33s's results using Microsoft Excel 2003's INT and MOD functions which are described at:
http://office.microsoft.com/en-us/assistance/HP052091421033.aspx
and
http://office.microsoft.com/en-us/assistance/HP052091821033.aspx
Regards,
John
Posts: 305
Threads: 17
Joined: Jun 2007
Remember the HP-71? The HP-71 had a function for all seasons, with 4 of them related to this issue:
x DIV y = IP(x/y)
RMD(x,y) = x - y * IP(x/y)
MOD(x,y) = x - y * FLOOR(x/y)
RED(x,y) = x - y * n, where n is the nearest integer to x/y
Well behaved functions, all.
Ya pays yer money, and ya takes yer choice!
Posts: 416
Threads: 78
Joined: Mar 2006
Quote:
"Rmdr" on the HP-33S acts like MOD, which returns +/-5 when the operands are of opposite sign. It seems as though the rule requires that the MOD remainder and the divisor be of the same sign.
What is the official theory behind integer division? I thought that:
a/b -> a = q x b + r
where q is the integer division result and r is the rest; I thought that:
0 <= r <= b
and thus r to be only positive, but the HP-33S returns r as if it was defined as:
0 <= |r| <= |b|
and so I'm probably wrong.
Can you clear me this point?
-- Antonio
P.S. I'd like to be a beta tester for HP calculators, in order to
assure a behaviour for which anyone is satisfied! I'm afraid the HP-33S has undergone a very fast and superficial design...
... or not?
-- Antonio
▼
Posts: 1,792
Threads: 62
Joined: Jan 2005
Antonio --
I'd say that Rodger's post offers a concise reference. If you want more detail and rigorous definitions, an on-line site (such as Wolfram's Mathematica site) should provide it.
BTW, did you notice that I announced an update to my Achive Articel #556 regarding SOLVE/INTEG?
-- KS
Edited: 3 Aug 2006, 10:34 p.m.
▼
Posts: 416
Threads: 78
Joined: Mar 2006
KS --
Forgive me for the long delay (I was in vacation).
Yes, I noticed your Article, and I printed it. It is very good and complete.
Thanks.
-- Antonio
Posts: 416
Threads: 78
Joined: Mar 2006
To anyone interested --
In this page, located in Wikipedia, there is a good background theory about integer division.
According to this theory, a division a / b can be expressed as
a = qd + r
where
0 <= r < |d|
or, briefly, r is **ALWAYS** positive.
So the HP-33S gives always the _wrong_ result when b is negative. The singularity of the IDIV command in EQN mode is purely accessory.
So, I feel to give this advice: use every HP-33S command but the INT÷ one. Or, be sure that the divisor is positive (and of course, don't use it into EQN mode).
Let's wait for a reviewed model. HP, are you listening?
-- Antonio
▼
Posts: 416
Threads: 78
Joined: Mar 2006
This applies to Rmdr too, of course!
-- Antonio
Posts: 135
Threads: 13
Joined: Jan 1970
Antonio,
Just out of curiosity, what do you use integer division for?
▼
Posts: 2,448
Threads: 90
Joined: Jul 2005
The last time I used integer division was in 2nd or 3rd grade, back in the early '70s. Then we learned what to do with the remainder and never looked back until now.
Posts: 406
Threads: 47
Joined: Jul 2005
Interger division is very handy in calendrical calculations, e.g.
▼
Posts: 406
Threads: 47
Joined: Jul 2005
A P.S. to my last post. The 16C in interger mode with its remainder function (RMD) and the 42S with its modulo function (MOD) also do the same job.
tm
Posts: 416
Threads: 78
Joined: Mar 2006
e.young wrote:
Quote:
what do you use integer division for?
Well, I don't use it that much, but when I buy something, I want it to work good.
If HP cannot set a decent behaviour for these functions, why put them into the machine? They could have been better replaced by more useful functions (like matrix dealing or a complex environment more complete).
That's why I'm trying to understand if they have done a good job. At the moment, it seems they didn't.
-- Antonio
▼
Posts: 406
Threads: 47
Joined: Jul 2005
I don't know what your the problem is but the function works well for me.
tm
Posts: 135
Threads: 13
Joined: Jan 1970
I understand what you mean. I never use integer division, so I don't know if it works on any of my 33s's
|