Questions tagged [bigint]
The bigint tag has no usage guidance.
14
questions
2
votes
1
answer
67
views
API design for Implementing NaN/Unknown values for custom numeric type
I'm gradually writing an arbitrary-precision arithmetic library for C++. I've decided it could be useful to have the default constructor produce an object of indeterminate value, rather than relying ...
1
vote
1
answer
81
views
C++ Long Integer Library
My second little project. I would like to hear all the critics possible.
This is a C++ Long Int library. It is self-education project, however I would like to make it better.
For me possible things to ...
2
votes
1
answer
148
views
Multiply two huge base-10 numbers in assembly
This post is a second part of my original post, Add two huge base-10 numbers, which deals with adding two huge base-10 numbers. However, in this case, I'm multiplying two non-negative whole numbers. ...
4
votes
1
answer
127
views
Add two huge base-10 numbers
This is some assembly code I've written to add two base-10 numbers. The input and output are represented as null-terminated ASCII strings, with digits in big-endian order.
I have also provided ...
1
vote
1
answer
72
views
Optimal Jelly string compressor in Rust
I'm writing some small programs to practice Rust, and this one's a string compressor for the golfing language Jelly (unofficial spec). It involves some non-ASCII stuff and bigints (from the ...
3
votes
0
answers
194
views
converting from byte arrays to strings of integers, and back
I have this code to go from an array of bytes (arbitrarily long) to a "bigint" string (really, an arbitrarily long string composed of integers 0-9), and go from that long integer string into ...
1
vote
1
answer
118
views
(FOLLOW-UP) Header-only bigint library written in c++20
This question is a follow up of Header only bigint library written in c++20.
I've made all (or almost all) the corrections suggested in the answers, plus some minor change here and there and a ...
6
votes
2
answers
775
views
Header only bigint library written in c++20
I made this over the course of a week and a half, to use it for some Project Euler problems. My goal was to make something relatively efficient that could be used as easily as a builtin type. I also ...
1
vote
1
answer
1k
views
Follow-up: How can we optimizing Java BigInteger operations?
This is the follow up question of How can we optimizing Java BigInteger operations?
Problem
Reduce the number to 1 in a minimal number of steps, following the rules:
...
0
votes
3
answers
591
views
How can we optimizing Java BigInteger operations?
Problem
Reduce the number to 1 in a minimal number of steps, following the rules:
If the number is even, divide it by 2.
Otherwise, increment or decrement it by 1.
Limit: ...
2
votes
1
answer
230
views
A BigInteger class
I made this project to practice object-oriented programming. I have implemented operator+ and operator+=. The rationale behind <...
1
vote
1
answer
92
views
Criticism on x86_64 nasm printBigInt and bigPow implementation
The first "method" I have coded is _bigPow which can pow(x, y) on any number which is really big. And the _printBigInt prints a very big integer. Plus I have tried to comment most parts of ...
4
votes
2
answers
138
views
SPOJ - ADDREV (Adding Reversed Numbers)
https://www.spoj.com/problems/ADDREV/
My answer to ADDREV challenge on SPOJ (link to the problem given above), written in JAVA, was accepted. However, the timing was 1.23 and memory used was 82M, ...
14
votes
4
answers
11k
views
BigInt class in C++
I made a BigInt class that supports almost all functions an int would.
The code seems too bulky and there might be a few bugs lurking here and there.
I would like ...