### WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

### Author Topic: BigDecimal 84  (Read 658 times)

0 Members and 1 Guest are viewing this topic.

#### c4ooo

• ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
• Super User
• CW Contest II Winner
• Join Date: Aug 2015
• Location: 127.0.0.1
• Posts: 878
• Post Rating Ratio: +7/-2
• ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
• Gender:
##### BigDecimal 84
« on: March 21, 2017, 08:00:09 pm »
I am writing a program that will allow you to do maths on numbers with up to 512 significant figures, 256 before and 256 after the decimal point.

I have a simple UI working, a rudimentary parser (only right to left order of operations, no PENTAS), and an addition algorithm. Numbers are stored in BCD.

Done:
• Rudimentary parser

[Some of] Todo:
• Negation/Subtraction
• Multiplication
• Division
• Trig functions (how?)
• Constants e, pi, and tao
• PENTAS ooo and parentheses
• Logs, exponents (how?)

For the items where i put "(how?)", i do now an algorithm that will calculate with the precision of 258 decimals.
« Last Edit: March 21, 2017, 08:01:40 pm by c4ooo »

C'est une signature

#### p2

• CodeWalrus Staff
• Super User
• Moderator
• CodeWalrus Supporter
• Join Date: Aug 2016
• Location: Germany
• Posts: 2030
• Post Rating Ratio: +8/-0
• *Wubba lubba dub dub*
• Gender:
##### Re: BigDecimal 84
« Reply #1 on: March 21, 2017, 08:03:31 pm »
uuh well that's nice.
But I guess it's not possible to implement this in the OS itself so it's always used...? :/

still a really usefull tool!
• Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

#### Snektron

• Lvl 69 Russian Snake
• CodeWalrus Staff
• Super User
• Topic Management
• Join Date: Dec 2014
• Location: Netherlands
• Posts: 3151
• Post Rating Ratio: +31/-0
• SSSssssss.....
• Gender:
##### Re: BigDecimal 84
« Reply #2 on: March 21, 2017, 08:08:29 pm »
Nice! In what language are you writing this? And do you have an indication of the speed?
regarding trig, you can find various articles on the internet, mostly they're an approximation with exponents (If you want to derive them
yourself, you'll need to use taylor polynomals ).
For exponents you'll only need to impelemnt ln(x) and e^(x), since you can rewrite any log(x, y) and x^y to a form using ln and e^(x). Good luck
• Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...

#### E37

• Full User
• Join Date: Jul 2016
• Location: Lihilzard Empire
• Posts: 209
• Post Rating Ratio: +9/-0
• I own 2 game consoles, a ti-83 and a ti-84!
##### Re: BigDecimal 84
« Reply #3 on: March 21, 2017, 10:36:16 pm »
uuh well that's nice.
But I guess it's not possible to implement this in the OS itself so it's always used...? :/
Through the use of hooks, it would definitely be able to always be used.
Is this in Axe?
Looks neat. You should post how you do the math.
• Consoles, mobile devices and vintage computers owned: Ti83,Ti84!
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert \$37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

#### c4ooo

• ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
• Super User
• CW Contest II Winner
• Join Date: Aug 2015
• Location: 127.0.0.1
• Posts: 878
• Post Rating Ratio: +7/-2
• ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
• Gender:
##### Re: BigDecimal 84
« Reply #4 on: March 21, 2017, 10:51:29 pm »
uuh well that's nice.
But I guess it's not possible to implement this in the OS itself so it's always used...? :/
I really don't know how the OS does math internally. Modding individual functions (add, sub etc) to use more decimals won't work becouse the OS would still use the 9 byte floats, which have 10(iirc) significant figs.

Is this in Axe?
Looks neat. You should post how you do the math.
Yep, this is in axe. I plan to make this open source once i have more stuff implemented

Nice! In what language are you writing this? And do you have an indication of the speed?
regarding trig, you can find various articles on the internet, mostly they're an approximation with exponents (If you want to derive them
yourself, you'll need to use taylor polynomals ).
For exponents you'll only need to impelemnt ln(x) and e^(x), since you can rewrite any log(x, y) and x^y to a form using ln and e^(x). Good luck
I don't have addition/division, but my guess is that it will be fine. Basically, it will always take longer for you to type the number then for the program to compute :3
Also, why would i need ln(x) if its just log(x)/log(e) ? As a start, i will only have base 10 log. BTW, how do i rewrite x^y as e^(x)

Edit: part of this post was accidentally deleted by a mod in an accident, i tried to restore it as best i could, but it might not be 100% perfect
« Last Edit: March 23, 2017, 10:09:40 pm by c4ooo »

C'est une signature

#### DJ Omnimaga

• Omni founder & CW co-founder
• CodeWalrus Staff
• Super User
• Forum Maintenance
• Original 5
• CodeWalrus Supporter
• Topic Management
• Join Date: Nov 2014
• Posts: 17910
• Post Rating Ratio: +89/-4
• Gender:
##### Re: BigDecimal 84
« Reply #5 on: March 22, 2017, 04:39:20 pm »
Awesome job c4ooo. This could be handy. As for TI-OS hook implementation the main issue tho would be that real vars would be significantly larger if they were used by this.
• Calculators owned: TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
• Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

#### p2

• CodeWalrus Staff
• Super User
• Moderator
• CodeWalrus Supporter
• Join Date: Aug 2016
• Location: Germany
• Posts: 2030
• Post Rating Ratio: +8/-0
• *Wubba lubba dub dub*
• Gender:
##### Re: BigDecimal 84
« Reply #6 on: March 23, 2017, 10:06:06 am »
uuh well that's nice.
But I guess it's not possible to implement this in the OS itself so it's always used...? :/
I really don't know how the OS does math internally. Modding individual functions (add, sub etc) to use more decimals won't work becouse the OS would still use the 9 byte floats, which have 10(iirc) significant figs.
we have a new project I see

yeah that's a huge problem there, I understand that. It's pretty sad tho as it's sometimes really usefull to be able to get such exact results ^^
how can we call ur tool and can we simply enter any long calculation and get the exact result? or is it more complicated?
• Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

#### Snektron

• Lvl 69 Russian Snake
• CodeWalrus Staff
• Super User
• Topic Management
• Join Date: Dec 2014
• Location: Netherlands
• Posts: 3151
• Post Rating Ratio: +31/-0
• SSSssssss.....
• Gender:
##### Re: BigDecimal 84
« Reply #7 on: March 23, 2017, 08:59:28 pm »
Nice! In what language are you writing this? And do you have an indication of the speed?
regarding trig, you can find various articles on the internet, mostly they're an approximation with exponents (If you want to derive them
yourself, you'll need to use taylor polynomals ).
For exponents you'll only need to impelemnt ln(x) and e^(x), since you can rewrite any log(x, y) and x^y to a form using ln and e^(x). Good luck
I don't have addition/division, but my guess is that it will be fine. Basically, it will always take longer for you to type the number then for the program to compute :3
Also, why would i need ln(x) if its just log(x)/log(e) ? As a start, i will only have base 10 log. BTW, how do i rewrite x^y as e^(x)

To rewrite x^y as a power of e you would use the fact x = e^ln(x)
x^y = (e^ln(x))^y = e^(y*ln(x)).
• Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...

#### c4ooo

• ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
• Super User
• CW Contest II Winner
• Join Date: Aug 2015
• Location: 127.0.0.1
• Posts: 878
• Post Rating Ratio: +7/-2
• ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
• Gender:
##### Re: BigDecimal 84
« Reply #8 on: March 24, 2017, 06:27:29 pm »
I added subtraction/negation. I feel fairly confident that everything should work, but i would like people to try different addition / subtraction equations and see if anything breaks

Notes:
To subtract two numbers you can use "A-B" or "A+ (small negation sign) B"
Multiple terms don't work yet.
Since output isn't trimmed, you might see something like: "-0", "00XX" or "X.XXX000".

C'est une signature

#### DJ Omnimaga

• Omni founder & CW co-founder
• CodeWalrus Staff
• Super User
• Forum Maintenance
• Original 5
• CodeWalrus Supporter
• Topic Management
• Join Date: Nov 2014
• Posts: 17910
• Post Rating Ratio: +89/-4
• Gender:
##### Re: BigDecimal 84
« Reply #9 on: March 24, 2017, 08:49:39 pm »
I'll see later if I can give it a try. I'm pretty busy. Glad to see progress
• Calculators owned: TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
• Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

#### _iPhoenix_

• Full User
• Join Date: Mar 2017
• Location: Encoded in Binary.
• Posts: 177
• Post Rating Ratio: +2/-1
• █████ ▼ ♪ Best music ♫
• Gender:
##### Re: BigDecimal 84
« Reply #10 on: March 24, 2017, 09:01:29 pm »
This is AMAZING (adds an 84 to his ever-growing list of wanted calcs)
• Calculators owned: A sentient TI-84+ CE, TI-85
• Consoles, mobile devices and vintage computers owned: TI-99/4a home computer
Help me with a project by voting here! Thanks!

"walruses are better than tuxedo chickens, all hail the great " ~ me

#### Snektron

• Lvl 69 Russian Snake
• CodeWalrus Staff
• Super User
• Topic Management
• Join Date: Dec 2014
• Location: Netherlands
• Posts: 3151
• Post Rating Ratio: +31/-0
• SSSssssss.....
• Gender:
##### Re: BigDecimal 84
« Reply #11 on: March 25, 2017, 12:35:34 am »
On a sidenote, there exists an algoritm that can eliminate a lot of work when multiplying two big numbers. It has something to do with divide and conquer.
• Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...

#### p2

• CodeWalrus Staff
• Super User
• Moderator
• CodeWalrus Supporter
• Join Date: Aug 2016
• Location: Germany
• Posts: 2030
• Post Rating Ratio: +8/-0
• *Wubba lubba dub dub*
• Gender:
##### Re: BigDecimal 84
« Reply #12 on: March 27, 2017, 08:51:38 am »
This is AMAZING (adds an 84 to his ever-growing list of wanted calcs)
I'm shocked it wasn't there before, especially after most of hte greyscale games//tools are for the 83+/84+ family
• Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

#### c4ooo

• ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
• Super User
• CW Contest II Winner
• Join Date: Aug 2015
• Location: 127.0.0.1
• Posts: 878
• Post Rating Ratio: +7/-2
• ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
• Gender:
##### Re: BigDecimal 84
« Reply #13 on: March 27, 2017, 07:26:36 pm »
Hmm, i was almost done implementing multiplication when Doors designed to delete the program that had all the arithmetic code x.x . I had axe backup disabled cause it's really glitchy in the new version. Luckily when i transferred the program to my computer i made a backup of the code, so it shouldn't be a big setback.

C'est une signature

#### c4ooo

• ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
• Super User
• CW Contest II Winner
• Join Date: Aug 2015
• Location: 127.0.0.1
• Posts: 878
• Post Rating Ratio: +7/-2
• ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
• Gender:
##### Re: BigDecimal 84
« Reply #14 on: March 29, 2017, 11:07:43 pm »