Equations with integrals are not shown correctly #38

Open
opened 2024-08-31 22:15:54 +00:00 by fpp3 · 7 comments
fpp3 commented 2024-08-31 22:15:54 +00:00 (Migrated from github.com)

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

Equations with integrals are not shown correctly. They all appear as [Erro na equação]
vcolella commented 2024-09-01 05:31:17 +00:00 (Migrated from github.com)

How are you writing the equation ?

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

How are you writing the equation ? The example `'∫(0, X, EXP(t), t)'` works fine: ![image](https://github.com/user-attachments/assets/e805fcc0-6cf1-4310-a97d-df74b459ecb3)
fpp3 commented 2024-09-01 14:11:29 +00:00 (Migrated from github.com)

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

On the emulator definitely works: ![image](https://github.com/user-attachments/assets/c9adcaa2-9db3-40a6-a4db-536154b201f5) But on the actual hardware it doesn't: ![image](https://github.com/user-attachments/assets/e0dfcd23-b91c-4a2e-89b5-3b6f5d25a416) 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](http://sitegui.com.br/editorHP). I attached the output file. [Resumenes.zip](https://github.com/user-attachments/files/16829206/Resumenes.zip) The calculator is on rom 2.15
vcolella commented 2024-09-02 03:54:19 +00:00 (Migrated from github.com)

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 ?

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 ?
Corte0 commented 2024-09-03 15:02:51 +00:00 (Migrated from github.com)

works fine on my 50G, rom 2.15
hp

works fine on my 50G, rom 2.15 ![hp](https://github.com/user-attachments/assets/93e8ed44-548b-4f8e-8c11-376bb1e420aa)
fpp3 commented 2024-09-03 15:26:41 +00:00 (Migrated from github.com)

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.

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.
vcolella commented 2024-09-06 08:43:47 +00:00 (Migrated from github.com)

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.

> 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 commented 2024-09-06 19:31:20 +00:00 (Migrated from github.com)

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.

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.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: sitegui/editorHP#38
No description provided.