10-01-2022, 06:45 PM
ln(x) and e^x are only as accurate as number of digits used in calculations, both work on summing terms of a series, the more terms the more accuracy and the longer the time to result.
b = b + ...
b+ String Math Update
|
10-01-2022, 06:45 PM
ln(x) and e^x are only as accurate as number of digits used in calculations, both work on summing terms of a series, the more terms the more accuracy and the longer the time to result.
b = b + ...
10-02-2022, 01:49 AM
Oh hey, BinPower$ not too bad either! This converts the y of X^Y to a binary number and then builds X^Y by figuring products of the powers of 2, something like that:
b = b + ...
sounds great can I get just a 4 basic math function large number aarbitrary presicion math library and I needd help making use of it in my base number conversion program I can get it up to base 430 using 2 digits per number digit using a markup type system.. can someone help me please??? it needs to be easy to use as well like s$ = add(a$,b$) or s$ = Mult(a$,b$) where it is a function that you can assign its result to an answer Gosh I am tired!!
also I need mod function and its opposite integer division.. that is you divide at it gives you an integer result...
Man! using 2 digits for one so you can do different bases blows my mind! How in the world.... !?!?
I do have code somewhere for converting decimal to any base using one symbol for going beyond 9 for digits eh the alphabet but you do run out of symbols to act as digits pretty quick. 2 digits ??? how 'bout 2 lines to rep one digit you can start to stack symbols over symbols. Oh I know use an array() and index so you wont even be limited to 2 digits!!! However big your array is how many symbols you can use! BTW what would the purpose be for a huge base like 1K of symbols, base 1024 ? Would that help speed up our string math? ![]()
b = b + ...
04-02-2025, 02:02 PM
(04-02-2025, 01:35 PM)bplus Wrote: Man! using 2 digits for one so you can do different bases blows my mind! How in the world.... !?!? 2 digits... like... hex?? ![]() 2 digits would (at most) let you represent base-65535 math. ![]()
04-02-2025, 02:26 PM
It's, 2 digit rep of digit symbols for another number base, Dragoncat's dream/vision idea. He is seeing something I don't yet quite get.
I need more motivation to get more interested, why do we need such big bases? faster math? like what computers do with Hex.
b = b + ...
04-02-2025, 03:11 PM
(04-02-2025, 02:26 PM)bplus Wrote: It's, 2 digit rep of digit symbols for another number base, Dragoncat's dream/vision idea. He is seeing something I don't yet quite get. Only reason I could think would be for compression. Take a base two number: 1111111111111111 (16 digits) Same number in base 10: 65535 (5 digits) Same number in base 16 (hex): FFFF (4 digits) Same number in base 256 (ASCII): CHR$(255) (1 digit) Bigger base, the more you can represent in a smaller number of digits. I don't think it'd necessarily be *faster* as you'd have much more complex math tables to look up and deal with, but it'd be *smaller* In base-1000, you might have the number 987,654 represented by (orange)(apple), where (orange) and (apple) are the two symbols you chose to represent 987 and 654 respectively. (orange)(orange)(apple)(apple) would be four symbols and represent 987,987,654,654 -- which is a lot more than 4-bits to represent! But... aside from that, I honestly can't see anyone needing a base-1000 for anything. And the work involved to generate the tables, look them up, translate them, blah blah blah... It's nothing I'd truly ever consider worth the effort to do. But I'm a farmer at heart. If it's within an acre, it's close enough, so all I need is base-"Looks good enough" around here. ![]() "Let's see... I need a chicken fence that goes around about a 20 foot by 30 foot area.... That'd be... this here old roll of wire, and probably some of this new roll, and maybe use some of these palettes to nail up to cover any gaps..."
04-03-2025, 04:14 PM
04-03-2025, 05:02 PM
Steve you should really write one of these. I'm sure it would be all that and a pound of bananas!
Seriously, Jack's approach I think is more along the lines of whatever the industry standard is... hex and bit flipping, etc. I haven't looked into that enough, but I went far enough with string math calculations to realize some operations just take too much time compared to the industry standard method. Now for accounting purposes, even with very large amounts, string math is great but probably not any faster than what runs online calculators. Pete
04-03-2025, 06:12 PM
https://qb64phoenix.com/forum/showthread.php?tid=787 -- I have.
![]() The one important thing that I want to bring to people's attention is string math doesn't need to be one digit at a time. 999 plus 999 ------ Most folks who write string math will solve that one digit at a time. 9+9 =18 18... Write the 8, carry the 1... 999+ 999 ------ ??8 (Carry 1) Then they solve the next single character. 9 + 9 + 1... 999+ 999 ----- ?98 (carry 1) Only 1 digit at a time... BUT!! There's no reason for that! Base 100 math follows the same rule set. 99 + 99 =198... which is 98 (carry 1). Base 1000 math is the same... and so on... So why not read 17 digits at a time as an unsigned integer 64, and do all that in a single calculation?? It's much faster than trying to go a single character at a time. Same with multiplication, but to a lesser degree. I think you can multiply 8 or 9 digits by 8 or 9 digits and have no overflow. It's not as efficient as addition, but it's still much better than just a single digit at once. |
« Next Oldest | Next Newest »
|