JuliaInterop / JuliaInterop/MathLink.jl

string() with weval-ed WExpr escape (\) some characters on arbitrary precision floating numbers with back quote

Open
#94 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
146
Forks
34
PR merge metrics
No merged PRs in 30d

Description

Here is an example session:

julia> set_GreedyEval(false)
false

julia> a=W`17.00000000000000000000000000000`
17.`30.230448921378276

julia> string(a)
"17.`30.230448921378276"

julia> W"Sin"(W"Sqrt"(a))
W`Sin[Sqrt[17.`30.230448921378276]]`

julia> string(W"Sin"(W"Sqrt"(a)))
"W`Sin[Sqrt[17.`30.230448921378276]]`"

julia> weval(W"Sin"(W"Sqrt"(a)))
-0.8313391791635062080451600446002018832298332563980832506813`30.091141206520284

julia> string(W"Sin"(W"Sqrt"(a)))
"W`Sin[Sqrt[17.\0`30.23044892137827]]`"

In the output of the last command, the 0 after the dot is escaped. In fact I have encountered this issue several times with back quote in "Real" numbers. Note that apparently this only happens if 'weval' was used on the WExpr. After, it seems no longer possible to restore the previous behaviour:

julia> string(W"Sin"(W"Sqrt"(a)))
"W`Sin[Sqrt[17.`30.230448921378276]]`"

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the session using set_GreedyEval(false), WExpr construction, weval, and string(). Start by tracing how string() serializes arbitrary-precision real values after weval. Done means back quotes and decimal characters are emitted without spurious escaping, while the reproduced WExpr output remains valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.