Page 3 of 3

Re: Elemental arithmetics; about Sqr(x^2)

Posted: Sat Sep 16, 2023 8:50 pm
by Piero
NicTheQuick wrote: Sat Sep 16, 2023 1:04 pm For all of you that are interested: I converted the Python fsum function to Purebasic: viewtopic.php?t=82457
Interesting! Thanks

I worked a lot with """very low level""" programming LONG time ago (assembly, C, C++ etc...) but then, often seeing poor human beings (colleagues working with desktop publishing) doing repetitive, machine-like stuff for the most part of the working day, I become very interested in "automation", like applescript.........

This floats/doubles thing is for me just a curiosity I had forgotten, but made me remember when I used "very large numbers math libraries" because I was curious about primes...

If I wasn't so old, I bet I would call some of you "superfast assembly maniacs"... :wink:

PS: this also reminds me I can ask mk-soft questions about prime numbers (to send him to psychiatric hospital) :mrgreen:

Re: Elemental arithmetics; about Sqr(x^2)

Posted: Wed Sep 20, 2023 4:26 pm
by jack
NicTheQuick wrote: Sat Sep 16, 2023 1:04 pm For all of you that are interested: I converted the Python fsum function to Purebasic: viewtopic.php?t=82457
that thread has a couple of links which eventually led me to the HP Forums where the sum problem was posted, but what I found interesting is the website of one of the members Druzyek that was inquiring about the CORDIC method https://www.hpmuseum.org/forum/thread-12180.html his website is interesting and loaded with calculator related projects http://joldosh.blogspot.com/

Re: Elemental arithmetics; about Sqr(x^2)

Posted: Sun Dec 24, 2023 2:45 am
by BarryG
Piero wrote: Wed Sep 13, 2023 1:38 pm

Code: Select all

Define b.d = 0.4
Define c.d = 0.8
Debug b+c
1.2000000000000001776356839
That's the correct internal result for calculations. When it comes time to display the result, you need to format it:

Code: Select all

Define b.d = 0.4
Define c.d = 0.8
Debug StrD(b+c) ; 1.2

Re: Elemental arithmetics; about Sqr(x^2)

Posted: Wed Dec 27, 2023 7:36 pm
by Piero
BarryG wrote: Sun Dec 24, 2023 2:45 amyou need to format it
Interesting! Thanks!
(I know: I'm being repetitive)