Author Topic: Arbitrary precision operations  (Read 10525 times)

0 Members and 2 Guests are viewing this topic.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Arbitrary precision operations
« Reply #30 on: February 17, 2011, 03:48:51 pm »
No offence but I'm still incredibly confused on what this does exactly ??? Could someone please explain?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Arbitrary precision operations
« Reply #31 on: February 17, 2011, 03:50:32 pm »
You have a number in L1, and a number in L2, the program merely does arithmetic on them.  The difference is that since you are storing them in a List, you have an arbitrary amount of digits to work with.  (123456789 would be stored as {123,456,789})

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Arbitrary precision operations
« Reply #32 on: February 17, 2011, 07:23:17 pm »
Ah ok, that's what I thought but it sounded like Qwerty said that isn't what happened. What is the number in L2 for?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Arbitrary precision operations
« Reply #33 on: February 17, 2011, 07:24:41 pm »
That's the second operand. The program basically does this:

<Number in L1> + <Number in L2> ->L1
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Arbitrary precision operations
« Reply #34 on: February 17, 2011, 08:08:28 pm »
Ah ok. Just curious, but why does there need to be an operation preformed? Couldn't you just take the number and store it?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Arbitrary precision operations
« Reply #35 on: February 17, 2011, 08:09:51 pm »
Um, the point of the program is to do arbitrary precision arithmetic. If it didn't perform arbitrary precision operations (+,-,*,/), it wouldn't need to exist.

EDIT: Finished the List-> String converter. It's slow, but I kind of had to abuse the math commands to get it to work at all because of the 7 digits per cell formatting.
« Last Edit: February 17, 2011, 08:30:33 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Arbitrary precision operations
« Reply #36 on: February 17, 2011, 09:05:24 pm »
Ohhhh ok. Sorry, been quite tired. I got it now. I thought the point was just to be able to store arbitrarily large numbers.

And cool, do you mind posting the list to string converter?

Edit:
Is it something like:

Code: [Select]
{0,1→L3
"_→Str1
For(A,1,dim(L1
{0,L1(A→L4
LinReg(ax+b) L3,L4,Y1
Equ►String(Y1,Str2
Str1+sub(Str2,1,length(Str2)-3→Str1
End
sub(Ans,2,length(Ans)-1→Str1
« Last Edit: February 17, 2011, 09:27:22 pm by meishe91 »
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Arbitrary precision operations
« Reply #37 on: February 17, 2011, 09:59:48 pm »
That's the general idea, although there's obviously some extra code to account for zero extensions.

EDIT: I accidentally my sentence.
« Last Edit: February 17, 2011, 10:00:10 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Arbitrary precision operations
« Reply #38 on: February 17, 2011, 10:06:12 pm »
Ah ok. Ya, I would have incorporated that but I don't know how you are storing just zeros into one list element so wasn't sure what to do.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Arbitrary precision operations
« Reply #39 on: February 17, 2011, 10:07:45 pm »
Wait so it is always 7 digits or is it just uniform digits?

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Arbitrary precision operations
« Reply #40 on: February 17, 2011, 10:09:53 pm »
It's always 7 digits per list element, although the user can enter as many or as few digits as they'd like (up to 6,993 digits per operand). The program itself handles all of the aligning. You just need to tell it what to operate on.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Arbitrary precision operations
« Reply #41 on: February 17, 2011, 10:11:49 pm »
Okay, so that program >_> It might be easier now... I thought it had to look for the longest string of numbers and make each element use that many digits :D

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Arbitrary precision operations
« Reply #42 on: February 17, 2011, 11:00:38 pm »
It's always 7 digits per list element, although the user can enter as many or as few digits as they'd like (up to 6,993 digits per operand). The program itself handles all of the aligning. You just need to tell it what to operate on.

Hmm, why not 6? That shows up the best in the list editor.

But then since you're converting it to a string anyway, I guess it doesn't matter. You could use 12 for more data in fewer bytes :D




Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Arbitrary precision operations
« Reply #43 on: February 17, 2011, 11:04:42 pm »
You could use up to 13 if you really wanted to conserve space. ;)

I like the output as a String idea. :)

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Arbitrary precision operations
« Reply #44 on: February 17, 2011, 11:20:06 pm »
Okay, torture test demo time.




Here's a pre-alpha version, using horrible coding techniques that I'll improve by the final version.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ