spirit icon indicating copy to clipboard operation
spirit copied to clipboard

Proposal for solving fraction_part causing 1.09e-6 generated as 1.9e-6 issue #792

Open sigbjorn opened this issue 1 year ago • 2 comments

Solves issue,

based on using int based compute of number of digits in a positive real-concept type, as provided in Shyft workaround by Paul Christoph Bätzing-Rosenvinge: https://gitlab.com/paul.christoph.batzing-rosenvinge

Ref to #792

sigbjorn avatar Sep 19 '24 14:09 sigbjorn

@hkaiser Tell me what you think?

djowel avatar Sep 20 '24 02:09 djowel

@hkaiser Tell me what you think?

I'm fine with this if all the tests pass.

hkaiser avatar Sep 20 '24 13:09 hkaiser

I'm not entirely convinced this is the best approach. There's likely a better way than multiplying by 10 in a loop to analyze decimal digits. That said, a more optimized implementation would require a deep understanding of IEEE floating-point representation. For now, I think this is an acceptable solution, as it addresses a real issue effectively.

Thanks for the PR!

saki7 avatar May 09 '25 07:05 saki7