Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Faster addition in string math. Now with multiplication!
#24
Now working with pi and found one more bug, which didn't affect all of the sqrt calcs, amazingly enough.

Before the DO:LOOP that uses the counter h&& = h&& + s begins, I added...

IF LEN(a$) < LEN(b$) THEN SWAP a$, b$

The loop takes care of some calculation where the VAL() drops leading zeros, but to do so properly, the fist variable a$ of a$ and b$ variables, must always be the longest string, or at lease equal in length for that leading zero conversion from VAL() to STR() to work properly.

I have edited the last post with this statement addition.

It looks like I lost a couple of seconds in the process. Oh well, fast and accurate beats faster and wrong.

Pete
Reply


Messages In This Thread
RE: Faster addition in string math. - by SMcNeill - 08-18-2022, 08:16 PM
RE: Faster addition in string math. - by Pete - 08-18-2022, 09:15 PM
RE: Faster addition in string math. - by SMcNeill - 08-18-2022, 09:59 PM
RE: Faster addition in string math. - by SMcNeill - 08-18-2022, 10:08 PM
RE: Faster addition in string math. - by SMcNeill - 08-18-2022, 11:46 PM
RE: Faster addition in string math. - by Pete - 08-19-2022, 10:07 AM
RE: Faster addition in string math. - by SMcNeill - 08-19-2022, 11:26 AM
RE: Faster addition in string math. - by Pete - 08-19-2022, 04:44 PM
RE: Faster addition in string math. - by SMcNeill - 08-19-2022, 04:58 PM
RE: Faster addition in string math. - by SMcNeill - 08-19-2022, 05:57 PM
RE: Faster addition in string math. - by Jack - 08-19-2022, 09:54 PM
RE: Faster addition in string math. - by SMcNeill - 08-19-2022, 11:48 PM
RE: Faster addition in string math. - by SMcNeill - 08-20-2022, 03:49 AM
RE: Faster addition in string math. - by Pete - 08-20-2022, 06:16 AM
RE: Faster addition in string math. - by SMcNeill - 08-20-2022, 06:41 AM
RE: Faster addition in string math. Now with multiplication! - by Pete - 08-22-2022, 02:26 AM



Users browsing this thread: 4 Guest(s)