Thread: Big Integer Implementation

  1. #16
    Registered User
    Join Date
    Apr 2020
    Posts
    2
    Quote Originally Posted by Zeus_ View Post
    Yeah, that looks a lot cleaner. I'll implement exactly that tonight. Also, just realised that the above code in the benchmark comment is an older version of what I was doing (which has a LOT of implementation errors). My file names were pretty messy and I seemed to have copy-pasted the wrong one (whenever I'm finished coding for a particular day, I store the progress until then separately. This way I record my progress on any project I'm working on). If you hadn't commented, I would've never looked through and realised that. So, thanks! In the current version that I'm writing, I've removed all template BASE related code and instead just implemented everything in base 10 (because it is way simpler to implement, and works way faster than any other base, plus reduces time and space consumed on construction). To compensate for that, I'm adding a to_base utility function that returns a BigInt converted to some base [2,16 (or maybe 36, as letters go up to 'z')] (obviously, with DIGITS_PER_SLOT digits at each index of its respective vector Digits).
    I have a 15-ish times better complexity for 1e5 100-digit number multiplications i.e. the algorithm finishes processing 15 times faster on average. Or, would you like me to try the implementation and figure out the hard way? I'm okay with either choice. Also, if I choose to implement using bitsets, trying to do things in binary like how it works for actual ints because this will obviously be incredibly fast,

  2. #17
    Registered User
    Join Date
    Aug 2019
    Location
    inside a singularity
    Posts
    308
    I can see (on the "What's New?" page) that someone called garrystark has replied to something in this thread. When I actually try to find the message, it doesn't exist. Was the message deleted?
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook, The Wizardry Compiled

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 10-01-2008, 07:45 PM
  2. Replies: 5
    Last Post: 06-12-2007, 02:18 PM
  3. determining if an integer is a legal integer
    By LiquidBlaze33 in forum C++ Programming
    Replies: 2
    Last Post: 10-09-2005, 07:06 PM
  4. finding an integer in an integer
    By Unregistered in forum C++ Programming
    Replies: 5
    Last Post: 05-09-2002, 07:25 PM
  5. determining integer/non-integer
    By gulakojhyau in forum C++ Programming
    Replies: 9
    Last Post: 03-08-2002, 01:25 PM

Tags for this Thread