Re: Another weirdest hp50g thing...
- From: Joe Horn <joehorn@xxxxxxxxxxx>
- Date: 17 Apr 2007 03:04:45 -0700
Massimo Santin wrote:
Why one minute?
Because that's the hard-coded time-out used by FACTOR. It first
checks ISPRIME?, and if the number is NOT prime, then it begins its
search for factors. If none are found after one minute (according to
the system clock), it gives up.
I think there two problems with your guess:
1. The time is dependent from the platform. What happens if you overclock
your calculator? Or when you underclock it to save battery? Or if HP will
release a new fantastic calculator much faster?
The "one minute" is *actual time*, so a faster machine will find more
factors than a slower machine. More iterations per minute yields more
factors found before timing out. This has already been demonstrated by
the fact that 2^67-1 does not factor at all on a real HP50g but it
*does* factor on the emulator running on a fast computer.
2. If you write programs you need to encapsulate the factorization code into
a TEVAL sequence or similar and you need to take decision on that. Not
elegant.
I totally agree.
It would be better to have a flag or an error variable.
I certainly agree with you and John Meyers about that. My hypothesis
stands, however: it's *POSSIBLE* to know when FACTOR times out. Nobody
has posted a counterexample to my hypothesis yet.
Another problem is that beahviour isn't documented (I just checked the
FACTOR command in CAS section of HP-49g+ Advanced User's
Reference Manual).
HP hasn't produced a good manual in many years. I hope that their
interest in rediscovering "The Old HP" will eventually lead to better
documentation.
Question: are there other parts/commands/algorthms that suffer of the same
problem/design decision?
Are you referring to secretly timing out, or to the more general
problem of secretly making decisions for the user which the user
should really know about? The latter would be very difficult to
enumerate, since there are so many, and since "should really know
about" is impossible to define precisely. As for the former, I
*think* that FACTOR, FACTORS, and COLLECT (on an integer) are the only
commands that time out without notification, except of course for the
commands whose *purpose* includes timing out without notification
(e.g. WAIT and some I/O commands). Anybody know of any other math
functions that secretly give up after a hard-coded amount of time?
-Joe-
.
- References:
- Another weirdest hp50g thing...
- From: usenet1 . 20 . quaxo
- Re: Another weirdest hp50g thing...
- From: Massimo Santin \(at GMail\)
- Re: Another weirdest hp50g thing...
- From: John H Meyers
- Re: Another weirdest hp50g thing...
- From: Joe Horn
- Re: Another weirdest hp50g thing...
- From: Massimo Santin \(at GMail\)
- Another weirdest hp50g thing...
- Prev by Date: Re: Spherical Triangle
- Next by Date: Re: Problems with ASC...???
- Previous by thread: Re: Another weirdest hp50g thing...
- Next by thread: 33s and its dam buttons.
- Index(es):
Loading