DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: High-bit Math? (128 or 256)  (Read 6,318 times)

Renegade

  • Tell me something you don't know...
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
    • Participated in NANY Challenge Three Times
    • Furry Fandom Badge - Furry Fandom
    • Linux User
High-bit Math? (128 or 256)
« on: July 24, 2013, 11:43 AM »
There are some calculations that I'd like to run, but I need some extremely big numbers and some extremely small numbers.

So I need something that will facilitate a very large bit-depth for the number types. e.g. 128 bit or 256 bit. I need integers and non-integers.

I only need to do:

  • +
  • - (redundant from above)
  • *
  • / (redundant from above)
  • ^

However, ^ needs to accommodate very small numbers or very precise numbers, e.g.

  • 1.00000000000000000000000000023423423
  • 0.000000000000000000000000000000000000000000000000000000000002342342

An nth root function would be convenient, but isn't needed.

Does anyone know of anything that works and that can help me? Any language is fine by me. Something C-ish would be nice, but I don't care.
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

x16wda

  • what am I doing in this handbasket?
  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 888
    • Participated in NANY Challenge Once
Re: High-bit Math? (128 or 256)
« Reply #1 on: July 25, 2013, 01:14 AM »
Did you look at this?
vi vi vi - editor of the beast

Renegade

  • Tell me something you don't know...
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
    • Participated in NANY Challenge Three Times
    • Furry Fandom Badge - Furry Fandom
    • Linux User
Re: High-bit Math? (128 or 256)
« Reply #2 on: July 25, 2013, 02:11 AM »
Did you look at this?

No. I've not seen that before. I'll look into it. Thanks!
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

Jibz

  • Cold Warrior
  • Developer
  • Joined in 2005
  • ***
  • Posts: 1,187
    • Programming School - Stage 1 Medal
    • Coding Snacks
    • Participated in NANY Challenge Four Times
Re: High-bit Math? (128 or 256)
« Reply #3 on: July 25, 2013, 08:41 AM »
There are a number of bignum libraries available for various languages.

A few examples that appear to support float operations are GNU MP, NTL, MAPM.

And if you can restrict your problems to integer math there are a lot more options (even python, which has a built-in arbitrary precision integer type).
"A problem, properly stated, is a problem on it's way to being solved" -Buckminster Fuller
"Multithreading is just one damn thing after, before, or simultaneous with another" -Andrei Alexandrescu

Original address: https://www.donationcoder.com/forum/index.php?topic=35545.0