Quote:

1 [sto] J

0 [sto] K

1 [chs] Expon

returns -1.71828182846 instead of correct 0.

I tried to correct it but failed to find code for Expon. I found the distributions.wp34s in xrom folder, but Expon is not there. Where is it?

Look in xrom/distributions/exponential.wp34s.

Here is a patch (I kind of tested it by building, flashing and trying).

Index: trunk/xrom/distributions/exponential.wp34s
===================================================================

--- trunk/xrom/distributions/exponential.wp34s (revision 3429)

+++ trunk/xrom/distributions/exponential.wp34s (working copy)

@@ -55,6 +55,8 @@

SPEC?

JMP cdf_infinite

[times]

+ x<0?

+ JMP ret_0

+/-

e[^x]-1

+/-

@@ -70,7 +72,6 @@

xOUT xOUT_NORMAL

expon_param:: RCL J

- GSB check_special_pos

- RTN

+ JMP check_special_pos

Since I was there, I think that similar bug in Expon_u should also be fixed.

I tried this one in console emulator.

Index: trunk/xrom/distributions/exponential.wp34s

===================================================================

--- trunk/xrom/distributions/exponential.wp34s (revision 3429)

+++ trunk/xrom/distributions/exponential.wp34s (working copy)

@@ -43,6 +43,8 @@

SPEC?

JMP cdf_infinite

[times]

+ x<0?

+ JMP ret_1

+/-

e[^x]

xOUT xOUT_NORMAL

@@ -55,6 +57,8 @@

SPEC?

JMP cdf_infinite

[times]

+ x<0?

+ JMP ret_0

+/-

e[^x]-1

+/-

@@ -70,7 +74,6 @@

xOUT xOUT_NORMAL
expon_param:: RCL J

- GSB check_special_pos

- RTN

+ JMP check_special_pos

*Edited: 13 July 2013, 5:01 p.m. *

Thanks for this. Patch applied now.

- Pauli

I am not sure what happened, but when I updated from SVN, the Expon_u became this:

XLBL"CDFU_EXPON"

xIN MONADIC

GSB expon_param

SPEC?

JMP cdf_infinite

x<0?

JMP ret_1

[times]

x<0?

JMP ret_1

+/-

e[^x]

xOUT xOUT_NORMAL

the first instance "x<0? jmp ret_1" (right before [times]) was not in the patch and should not be there.

Hopefully fixed now.

I had to manually apply the patch -- the patch program didn't like me.

Pauli

I've uploaded a new build to SVN. It should fix the RUN vs STOP issue, too.