10-14-2022, 11:32 AM
thanks Pete for testing
I only added the Sqr function to the eval but adding the nth root would be easy enough
I only added the Sqr function to the eval but adding the nth root would be easy enough
decfloat -- again
|
10-14-2022, 11:32 AM
thanks Pete for testing
I only added the Sqr function to the eval but adding the nth root would be easy enough
10-14-2022, 01:41 PM
Pete, I added the root function, see the previous post
10-14-2022, 06:36 PM
This looks promising. Please check this. I put in root(-27, 3) and got 3. It should report -3. What impressed me was how fast it produced root(8, 500). For string math, anything over 200th root started to take a noticeable time to produce.
Pete
10-14-2022, 08:09 PM
thanks Pete for testing, edited the code, it now extracts negative number with an odd root
10-14-2022, 08:20 PM
Yep, "It's always something." This is so cool. I really wish I could wrap my head around bit flipping, but it just doesn't come together for me. Too strung out on strings, I guess.
Pete
10-14-2022, 08:28 PM
just in case you are interested, I changed the exponential ^ operator to use integer power if the right-hand side is integer, that allows raising negative numbers to some integer power
10-14-2022, 08:45 PM
Good idea.
Curious. How far can bit-flipping go and maintain accuracy? For instance, string math can go on for several thousands of digits before certain _INTEGER64 loops would be exceeded. Pete
10-14-2022, 08:56 PM
I don't know how far you could go but it gets slow once you go pass 10000 digits
btw, changed the code again to take into account negative integer powers, so this works (-2)^(-3)
10-14-2022, 09:06 PM
String math holds together pretty well at 10,000 digits for regular arthritic, but powers and roots of a few hundreds make it run stupid slow. Bit flipping seems to handle those operations at a much better rate of speed.
Pete |
« Next Oldest | Next Newest »
|