Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
18 May, 2013, 19:48:31 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1] 2 3 ... 5   Go Down
  Print  
Author Topic: BigNumNum Cruncher -  (Read 3184 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
sammyMaX
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 15 May, 2013, 13:20:26
Date Registered: 18 April, 2011, 18:01:37
Posts: 191


Topic starter
Total Post Ratings: +7

View Profile
« on: 13 August, 2011, 22:19:36 »
+1

BigNumNum Cruncher is a bignum program for the Nspire, written in C. It should be able to handle numbers as big as the Nspire's RAM allows it to be, with one digit per byte. (This may not mean output being up to (number of available bytes of RAM) digits long, since in the instance 2^1000000, it would need to store 2^999999 to get to 2^1000000) I have finished the addition and multiplication functions, and have the basic GUI going, but a lot of work has to be done (Powers in beta testing for now) I have no school on 9/29/11, so hopefully some major work can be done.

BigNumNum Cruncher originally started in Lua but since then, I have moved over to C, since Lua was far too slow for this program. Numbers are stored in my program as arrays of ints, with only 4 digits able to be used in each int because of overflow. (Perhaps there is a way to fully utilize the RAM and double capacity?)

Spoiler for Changelog:
Version 0.01 Lua with GUI done
Version 0.02 Lua with addition
Version 0.03 Lua with subtraction
Version 0.04 Lua with multiplication and powers
Version 0.05 Lua with bug fixes

Version 0.10 C with GUI and addition
Version 0.11 C with less bugs
Version 0.12 C with multiplication
Version 0.13 C with powers and results less than 37 digits
Version 0.14 C with major speed up in addition and subtraction algorithms
Version 0.15 C major release memory allocation bug fixed


* screenshot.jpeg (23.78 KB, 320x240 - viewed 456 times.)

* screen.jpg (12.99 KB, 320x240 - viewed 256 times.)

* YAY.png (3.33 KB, 320x240 - viewed 223 times.)

* yayayayayz.png (3.33 KB, 320x240 - viewed 199 times.)

* EPIC.png (3.46 KB, 320x240 - viewed 141 times.)
« Last Edit: 21 January, 2012, 00:03:14 by sammyMaX » Logged


Are you wondering who Sammy is? My avatar is Sammy.
   
sammyMaX
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 15 May, 2013, 13:20:26
Date Registered: 18 April, 2011, 18:01:37
Posts: 191


Topic starter
Total Post Ratings: +7

View Profile
« Reply #1 on: 14 August, 2011, 17:05:34 »
0

Update: I have decided to move over and start the program in C with Ndless 2.0. It will be much faster, and when Ndless 3.0 comes out, only a few minor changes will have to be made. Expect an alpha in three to four days.
Logged


Are you wondering who Sammy is? My avatar is Sammy.
   
sammyMaX
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 15 May, 2013, 13:20:26
Date Registered: 18 April, 2011, 18:01:37
Posts: 191


Topic starter
Total Post Ratings: +7

View Profile
« Reply #2 on: 21 August, 2011, 22:47:55 »
0

Here is the UI in C (so far not functional):
On a side note, I am having a lot of trouble implementing the GMP-style limbs and branches, (Ndless isn't letting me do divison or mods) so I will revert back to my old system of numbers.


* gui.png (2.81 KB, 320x240 - viewed 391 times.)
« Last Edit: 22 August, 2011, 03:58:27 by sammyMaX » Logged


Are you wondering who Sammy is? My avatar is Sammy.
   
Spyro543
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Today at 16:59:56
Date Registered: 15 April, 2011, 01:42:09
Location: Ohio
Posts: 990


Total Post Ratings: +59

View Profile WWW
« Reply #3 on: 22 August, 2011, 02:53:46 »
0

Awesome looking! (Why would you even need to calculate numbers this big anyways? Tongue)
Logged

t0xic_kitt3n
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 13 May, 2013, 01:56:35
Date Registered: 16 June, 2010, 20:46:00
Location: w,x,y,z
Posts: 1583


Total Post Ratings: +32

View Profile
« Reply #4 on: 22 August, 2011, 03:35:34 »
0

Are you having trouble with 64-bit (or possibly 32-bit) integer division? Is there a compiler error when you do so?
« Last Edit: 22 August, 2011, 03:35:54 by t0xic_kitt3n » Logged




██████  ██  ██  ███████           ████    ██    ██   ██ ███████
█ ██ █  ██  ██   ██   █          ██  ██  ████   ███ ███  ██   █
  ██    ██  ██   ██             ██   ██ ██  ██  ███████  ██    
  ██    ██  ██   ██  █         ██       ██  ██  ███████  ██  █
  ██    ██████   █████         ██       ██  ██  ██ █ ██  █████ 
  ██    ██  ██   ██  █         ██   ███ ██████  ██   ██  ██  █
  ██    ██  ██   ██             ██   ██ ██  ██  ██   ██  ██    
  ██    ██  ██   ██   █          ██  ██ ██  ██  ██   ██  ██   █
 ████   ██  ██  ███████           █████ ██  ██  ██   ██ ███████

sammyMaX
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 15 May, 2013, 13:20:26
Date Registered: 18 April, 2011, 18:01:37
Posts: 191


Topic starter
Total Post Ratings: +7

View Profile
« Reply #5 on: 22 August, 2011, 04:03:41 »
0

Spyro - Thanks! Most people won't need it, but it could be cool to show to your friends, and for those in math competitions (like Mathcounts) it could be a life saver.

Toxic kitten - yes, I am getting an error when doing mod (%) and division. I get compiler errors like "undefined reference to '__aeabi_idivmod'" or "undefined reference to '__aeabi_uidiv'". It would really help if you could explain this to me.
Logged


Are you wondering who Sammy is? My avatar is Sammy.
   
t0xic_kitt3n
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 13 May, 2013, 01:56:35
Date Registered: 16 June, 2010, 20:46:00
Location: w,x,y,z
Posts: 1583


Total Post Ratings: +32

View Profile
« Reply #6 on: 22 August, 2011, 07:00:04 »
0

You are getting errors from newlib then. Make sure you have the latest version of GCC.
Logged




██████  ██  ██  ███████           ████    ██    ██   ██ ███████
█ ██ █  ██  ██   ██   █          ██  ██  ████   ███ ███  ██   █
  ██    ██  ██   ██             ██   ██ ██  ██  ███████  ██    
  ██    ██  ██   ██  █         ██       ██  ██  ███████  ██  █
  ██    ██████   █████         ██       ██  ██  ██ █ ██  █████ 
  ██    ██  ██   ██  █         ██   ███ ██████  ██   ██  ██  █
  ██    ██  ██   ██             ██   ██ ██  ██  ██   ██  ██    
  ██    ██  ██   ██   █          ██  ██ ██  ██  ██   ██  ██   █
 ████   ██  ██  ███████           █████ ██  ██  ██   ██ ███████

Lionel Debroux
LV10 31337 u53r (Next: 2000)
**********
Online Online

Gender: Male
Last Login: Today at 19:24:33
Date Registered: 17 December, 2009, 09:37:25
Location: France
Posts: 1853

Total Post Ratings: +208

View Profile WWW
« Reply #7 on: 22 August, 2011, 07:36:32 »
0

Quote
"undefined reference to '__aeabi_idivmod'" or "undefined reference to '__aeabi_uidiv'". It would really help if you could explain this to me.
Don't use the -nostdlib compiler option Smiley
Logged

Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.
Spyro543
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Today at 16:59:56
Date Registered: 15 April, 2011, 01:42:09
Location: Ohio
Posts: 990


Total Post Ratings: +59

View Profile WWW
« Reply #8 on: 22 August, 2011, 13:14:31 »
0

Spyro - Thanks! Most people won't need it, but it could be cool to show to your friends
Most of my friends don't even know what a graphing calculator is. Tongue
Logged

sammyMaX
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 15 May, 2013, 13:20:26
Date Registered: 18 April, 2011, 18:01:37
Posts: 191


Topic starter
Total Post Ratings: +7

View Profile
« Reply #9 on: 22 August, 2011, 14:43:06 »
0

The -nostdlib option was the problem. (from me just modifying the makefile of the Hello sample and never catching on to that) Thanks guys!

Lol Spyro, in my school graphing calculators are required for 9th grade and above math. TI must make a lot of money off that...
Logged


Are you wondering who Sammy is? My avatar is Sammy.
   
sammyMaX
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 15 May, 2013, 13:20:26
Date Registered: 18 April, 2011, 18:01:37
Posts: 191


Topic starter
Total Post Ratings: +7

View Profile
« Reply #10 on: 22 August, 2011, 16:35:39 »
0

Some random tidbits about Lua vs. C (for Nspire programming)
1. C is much better for input, because it keys being pressed instead of the character a button corresponds to (which is sometimes a weird, non-standard character)
2. C is MUCH faster
3. Lua supports color and developing for it is much easier
4. For my program, where the input is a variable length, C is HORRIBLY hard to code. In Lua a string can be any length; getting C to create a string that can be a variable size (but stays the same length after declaration) requires malloc(), and when the string length changes each time you type... UGH!!!
Logged


Are you wondering who Sammy is? My avatar is Sammy.
   
calc84maniac
Epic z80 roflpwner
Coder Of Tomorrow
LV11 Super Veteran (Next: 3000)
*
Offline Offline

Gender: Male
Last Login: 14 May, 2013, 10:02:35
Date Registered: 28 August, 2008, 05:09:05
Location: Right behind you.
Posts: 2735


Total Post Ratings: +373

View Profile
« Reply #11 on: 22 August, 2011, 18:25:48 »
0

getting C to create a string that can be a variable size (but stays the same length after declaration) requires malloc(), and when the string length changes each time you type... UGH!!!
Try using realloc(), that will resize a buffer without modifying its contents (and may return a new pointer if the buffer couldn't be resized in-place). Of course, you may not want to reallocate for every character typed, so you could probably increase/decrease the size by, for example, 32 bytes at a time.
Logged

"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman
sammyMaX
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 15 May, 2013, 13:20:26
Date Registered: 18 April, 2011, 18:01:37
Posts: 191


Topic starter
Total Post Ratings: +7

View Profile
« Reply #12 on: 26 August, 2011, 02:17:19 »
0

True... I really don't know what I was thinking when I wrote that post Huh? because I had thought of realloc(), but for some reason it still seemed like a pain in the butt to write.

An update: I have 3-4 weeks to finish (at least get the most important power, factorial and multiplication functions done) before school starts. I plan on writing division and nth root approximation, but I haven't really learned that yet, so it may be far later in development when that gets implemented.
Logged


Are you wondering who Sammy is? My avatar is Sammy.
   
t0xic_kitt3n
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 13 May, 2013, 01:56:35
Date Registered: 16 June, 2010, 20:46:00
Location: w,x,y,z
Posts: 1583


Total Post Ratings: +32

View Profile
« Reply #13 on: 26 August, 2011, 06:48:09 »
0

I just make my string buffers long enough for whatever may occur. I never thought of using realloc Tongue
Logged




██████  ██  ██  ███████           ████    ██    ██   ██ ███████
█ ██ █  ██  ██   ██   █          ██  ██  ████   ███ ███  ██   █
  ██    ██  ██   ██             ██   ██ ██  ██  ███████  ██    
  ██    ██  ██   ██  █         ██       ██  ██  ███████  ██  █
  ██    ██████   █████         ██       ██  ██  ██ █ ██  █████ 
  ██    ██  ██   ██  █         ██   ███ ██████  ██   ██  ██  █
  ██    ██  ██   ██             ██   ██ ██  ██  ██   ██  ██    
  ██    ██  ██   ██   █          ██  ██ ██  ██  ██   ██  ██   █
 ████   ██  ██  ███████           █████ ██  ██  ██   ██ ███████

sammyMaX
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 15 May, 2013, 13:20:26
Date Registered: 18 April, 2011, 18:01:37
Posts: 191


Topic starter
Total Post Ratings: +7

View Profile
« Reply #14 on: 26 August, 2011, 16:51:35 »
0

Yeah, that works, but it isn't very elegant (seriously, using up like half a KB of RAM is not really a worry, it just doesn't seem pretty)
Logged


Are you wondering who Sammy is? My avatar is Sammy.
   
Pages: [1] 2 3 ... 5   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.296 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.