[WP34s] Next problem?



#2

Good to see the usual MOD now in the current release. :-)

But now I've found another problem: contrary to all other calculators that I've checked (HP50g, HP39gII, TI-Nspire, ...) the WP34s returns a negative number for GCD whenever one of its arguments is negative.

Is this intended or just another bug?

IMO the main math functions should work as in all other calculators, else porting any programs is really a nightmare. :-(

Franz


#3

The sign behaviour of GCD is intended, although I don't remember why I did it that way.

Fortunately, the fix isn't onerous:

        LBL'GCD'
ABS
x[<->] Y
ABS
x[<->] Y // Leave this out if you don't care about Last X
GCD
END

One of the joys of a programmable calculator is you can define your own functions and variants.


MOD is by no means a certainty at this stage.


- Pauli


#4

Quote:
Fortunately, the fix isn't onerous:

Of course not, but it's indeed not nice that the WP34s defines its own math rules. I really don't like to have a (long) list of exceptions where the WP34s return different results than every other calculator, and I would have to 'fix' all those non-standard WP34s functions myself in each program.

Absolutely bad behaviour! :-(

Franz


#5

Easier fix that doesn't do the right thing with Last X:

        GCD
ABS


I don't remember why I did this so we might as well see what behaviour people want GCD and LCM to have with negative arguments?


Being different to other calculators is fine and good when the rest aren't completely correct. The 41/42 SIGN function e.g. I'm glad to be different there e.g.


- Pauli


#6

Quote:
Being different to other calculators is fine ...

... but not if it's completely against all math standards and different to EVERY other calculator.

And BTW, if for example -4 ENTER 6 GCD returns -2, then this is not the GCD but the LCD. ;-)

Franz


#7

I'm just curious: why would you ever want to use GCD or LCM with a negative number?!

Nigel (UK)


#8

Quote:
I'm just curious: why would you ever want to use GCD or LCM with a negative number?!

Counter question: why not? ;-)

(division is also defined for negative numbers/integers)

Can't you imagine that you need those GCD/LCM functions in any number theory algorithm? Should you then always have to check if any of the arguments is negative to be sure that the WP34s program will work correctly also with such numbers?

Franz

Edited: 28 June 2012, 10:24 a.m.

#9

Quote:
I don't remember why I did this so we might as well see what behaviour people want GCD and LCM to have with negative arguments?

A negative GCD is nonsense in any case. If you find a negative common divider, you'll immediately have a positive one which is obviously greater. Hence, the GCD is defined as element from the set of non-zero positive integers. Please correct me if I overlooked something.

#10

Now apply the same logic to the LCM.....-infinity is looking good for all inputs regardless of sign :-)


- Pauli


#11

Quote:
Now apply the same logic to the LCM.....-infinity is looking good for all inputs regardless of sign :-)

Sorry but that's nothing else than a bad joke.

First GCD/LCM are defined as non-negative integers ('natural numbers'), and -infinity isn't even a 'number' at all.

Franz

#12

Quote:
Now apply the same logic to the LCM.....
Pointing out a misnomer doesn't break either logic nor a definition all mathmaticians agreed upon ;-).

#13

Good that at least one other here supported my GCD/LCM complaint. ;-)

And we have finally convinced Pauli, because it's already changed in the SVN - unfortunately not yet compiled.

Franz


#14

Quote:
And we have finally convinced Pauli, because it's already changed in the SVN - unfortunately not yet compiled.

Pauli, before you go to bed tonight could you please make a new build with the current SVN 3191?

So we would have the GCD/LCM fixed - and also your other todays 'rearrangements' are very much appreciated (at least by me)! ;-)

Franz

#15

Might as well use the simpler definition as the first one puts the wrong (ABS X) value in LastX anyway.

Plus, I don't see how having LastX will help you undo an incorrect GCD.


#16

Quote:
Plus, I don't see how having LastX will help you undo an incorrect GCD.

And this is true for all functions with 2 operands. That's why I've suggested almost 1 year ago that for every binary operation both X and Y should be saved in L and I (as for complex operations) - but my idea didn't find any open ear.

Franz


#17

I assume by functions you are excluding basic arithmetic and powers, but LastX helps with any reversible function, such as % or Logx(Y), so it is still useful in many 2 argument functions.

#18

Just an info:

BSRF & BSRB missing in the last build (at least not in any catalog).

And I would also really appreciate having access to the indirect calls iBACK/iBSRF/iBSRB and even the 2 commands A..D-> and ->A..D.

Maybe there could be made a (temporary?) 'expert' build with all these commands? ;-)

Franz

Edited: 1 July 2012, 6:18 a.m.


#19

Quote:
And I would also really appreciate having access to the indirect calls iBACK/iBSRF/iBSRB and even the 2 commands A..D-> and ->A..D.

Why? These indirect instructions are almost unusable in reality and they produce completely unmaintainable code. Please demonstrate a non-contrived use case for these, just wanting them isn't sufficient. People want everything, usually without thinking. If you do manage to demonstrate a sufficiently good usage of these, we might consider adding them to the firmware. The use case will, of course, have to be significantly better than any other alternative that doesn't use them. Even including CASE is dubious -- if XROM didn't need it, it wouldn't be there.

A..D-> and ->A..D are not going to be exposed. The stored contents disappear forever if you are not very careful -- both writing the program and when running it (they'll disappear if you stop running a program using R/S e.g.). Plus, they'll interact rather badly with the solver. Not something we want available in a "safe" programming environment.

Quote:
Maybe there could be made an 'expert' build with all these commands?

Nobody is stopping you upgrading your host machine and building your own image with these included. We, however, are not planning on doing so.

- Pauli


#20

I second Pauli's opinion completely :-)

#21

Any plans for a new build with the last changes?

BSRF & BSRB aren't accessable in the last build, and also DBLON/DBLOFF have been moved to the MODE catalog (which is indeed to right place) but are still in P.FCN (contrary what the current manual says).

Franz


#22

Quote:
DBLON/DBLOFF have been moved to the MODE catalog (which is indeed to right place) but are still in P.FCN (contrary what the current manual says).

In this rare case the SW is wrong ;-) We'll get that repaired.

#23

Quote:
In this rare case the SW is wrong ;-) We'll get that repaired.

And you've removed again BSRF/BSRB as I can see in your last SVN. Well, it seems you don't like 'experts' working with the WP34s. ;-)

BTW, the next build will be SVN 3200, a perfect number for the final version ... :-)

Franz


#24

Quote:

And you've removed again BSRF/BSRB ...


Not true - I just made that file matching the build as is :-) AFAICS there, DBLON & Co. shouldn't be in P.FCN anymore. Strange.

Number-wise, I'd prefer 3535 ;-)

Edited: 3 July 2012, 8:04 a.m. after one or more responses were posted


#25

Quote:
Not true - I just made that file matching the build as is :-)

Well, both functions BSRF/BSRB existed for a long time. 3 days ago Pauli removed them. Then 1 day later he put them back in again, and finally today you removed them again - really funny.

I know why I prefer making all my software projects myself as a single programmer - it's not nice having such troubles with a programming team. ;-)
Quote:
AFAICS there, DBLON & Co. shouldn't be in P.FCN anymore. Strange.

But they are. Putting them into MODE was Pauli's last change, but he didn't make a build after this last source change.

#26

Well, also the expert's catalogue existed for a long time. Shall we reintroduce it? ;-) (Learning proceeds in steps sometimes ...)


#27

Quote:
Well, also the expert's catalogue existed for a long time. Shall we reintroduce it? ;-)

Oh my god, of course not! I was the first (and only) one who complained about this arbitrary distribution of 'expert' commands into a separate catalog.
Quote:
(Learning proceeds in steps sometimes ...)

Yes, and in this case it were YOUR steps - and quite a lot I would say ... ;-)

#28

Quote:

Yes, and in this case it were YOUR steps - and quite a lot I would say ... ;-)


If it makes you happy, so be it. And being able to learn isn't the worst insult we can get from anybody ;-) Anyway *we've made* the WP 34S while you ...?

#29

Quote:
Anyway *we've made* the WP 34S while you ...?

Well, just look at my website and you'll know what I have made.

http://fhub.110mb.com/

And that's only a very small part of my programming projects, not to forget even 3 programs for the WP34s: TVM, TRIGON and the Polynomial RootSolver PRS (which is no longer available though).

And should I count all my bug-reports, suggestions ... ?

Franz


#30

Quote:
And should I count all my bug-reports, suggestions ... ?

Yes, please ;-)

#31

Quote:
Yes, please ;-)

Better not, I don't think that such a long posting would be supported by the forum software. ;-)

I'm rather waiting for the magic build number 3200 ... :-)


#32

Bad luck - just wanted to keep you busy for a while ;-/


#33

Quote:
Bad luck - just wanted to keep you busy for a while ;-/

Don't worry, after the next build (when DBLON/OFF is in the correct catalog) you'll not hear anything from me for a very long time, because I consider the next SVN 3200 as final version.

But there would be a much easier way for you: if you can't stand me then simply ignore my postings!

Franz


#34

Quote:
... after the next build (...) you'll not hear anything from me for a very long time...

:-D 73 and counting ;-)
#35

Quote:
Oh my god, of course not! I was the first (and only) one who complained about this arbitrary distribution of 'expert' commands into a separate catalog.

You were not alone.

#36

Quote:
You were not alone.

Yes, you're right - there were even more situations where we both had the same opinion. :-)

BTW, could you please make a quick SVN build? The last version isn't up-to-date and the next build number 3200 would be a nice version number. ;-)

Edit: That was really quick - many thanks Marcus!

Now let's hope that nobody finds a bug anymore ... ;-)

Franz

Edited: 3 July 2012, 5:12 p.m.


#37

Quote:
Now let's hope that nobody finds a bug anymore ... ;-)

That's easy. From now on we call anything unexpected a "feature".


#38

Quote:
That's easy. From now on we call anything unexpected a "feature".

LOL, indeed a good idea!

But it's not really a new idea, many programmers and companies already do this. ;-)

Possibly Related Threads...
Thread Author Replies Views Last Post
  [WP34s] Possible problem with matrix inversion Dieter 10 442 01-07-2013, 03:07 PM
Last Post: Dieter
  [WP34S] WP34S firmware on the AT91SAM7L-STK dev kit? jerome ibanes 1 157 10-04-2012, 04:59 PM
Last Post: Paul Dale
  [WP34S] Problem Running wp34s_lib.pl in Mac OS X Les Wright 17 610 03-21-2012, 06:05 PM
Last Post: Neil Hamilton (Ottawa)
  WP34s - CLP Problem John Abbott (S. Africa) 7 283 02-27-2012, 01:10 PM
Last Post: John Abbott (S. Africa)
  [WP34s] Assembler problem fhub 2 150 01-19-2012, 07:32 PM
Last Post: Neil Hamilton (Ottawa)
  [wp34s] Incomplete Gamma on the wp34s Les Wright 18 648 12-06-2011, 11:07 AM
Last Post: Namir
  [wp34s] Romberg Integration on the wp34s Les Wright 2 199 12-04-2011, 10:49 PM
Last Post: Les Wright
  97 Card Reader Problem (NOT gummy problem) Peter Khor 5 253 10-04-2000, 11:03 AM
Last Post: ErikWahlin

Forum Jump: