editorHP icon indicating copy to clipboard operation
editorHP copied to clipboard

Equations with integrals are not shown correctly

Open fpp3 opened this issue 1 year ago • 7 comments

Equations with integrals are not shown correctly. They all appear as [Erro na equação]

fpp3 avatar Aug 31 '24 22:08 fpp3

How are you writing the equation ?

The example '∫(0, X, EXP(t), t)' works fine: image

vcolella avatar Sep 01 '24 05:09 vcolella

On the emulator definitely works: image

But on the actual hardware it doesn't: image

Here are all the equations in that title:

'∫(-∞, ∞, f(τ)*µ(t-τ), τ) = ∫(-∞, t, f(τ), τ)'
'∞'
'∫(-∞, ∞, f(τ)*µ(t-τ), τ)'
'∫(0, X, EXP(t), t)'
'∫(0, X, EXP(t), t)'

btw, I'm using a local version of the repo that has pr 37 merged to fix the infinite syntax error. The same thing happens on the version available at sitegui.com.br/editorHP. I attached the output file. Resumenes.zip

The calculator is on rom 2.15

fpp3 avatar Sep 01 '24 14:09 fpp3

Interesting, I don't have my 50G with me right now but will test as soon as I can. In the mean time, have you tried opening the file with another calculator ?

vcolella avatar Sep 02 '24 03:09 vcolella

works fine on my 50G, rom 2.15 hp

Corte0 avatar Sep 03 '24 15:09 Corte0

Well, re flashed rom 2.15 with the 2mb fix and now everything works fine. But, when I enabled the "51 Fraction mark: ," flag it started doing the "erro na equãçao" again.

fpp3 avatar Sep 03 '24 15:09 fpp3

when I enabled the "51 Fraction mark: ," flag it started doing the "erro na equãçao" again.

Nice catch 👍 Looks like by default the compiler uses . as fraction mark, considering the header %%HP: T(3)A(R)F(.);.

So your equation is saved as a string like : "'∫(-∞, ∞, f(τ)*µ(t-τ), τ) = ∫(-∞, t, f(τ), τ)'"

In order to recover the equation for displaying, this string is evaluated with STR→. When you change the calculator's fraction mark to , the expected argument separator becomes ;.

Since the equation is hardcoded with ,, STR→ fails and throws an error, bringing us to the "Erro na equação" message.

I think the quickest solution might be to implement a fraction mark option in the editor's GUI to appropriately save the equation's string.

vcolella avatar Sep 06 '24 08:09 vcolella

I did some more testing and it seems that simply change the comma separators for semicolon works just fine no matter how FLAG 51 is set. I'll try to implement this in a PR.

vcolella avatar Sep 06 '24 19:09 vcolella