All Questions
Tagged with integer-arithmetic or integer
396 questions
3
votes
2
answers
849
views
Three non-negative integer encoding techniques in Java
Intro
In this post, I will present three (3) non-negative integer encoding techniques:
Elias gamma coding
Elias delta coding
Golomb-Rice coding
Code
...
5
votes
1
answer
407
views
Positive Integer Class Supporting Arbitrary Number of Digits
I have implemented an elementary positive integer class that supports addition, subtraction, and multiplication for an arbitrary number of digits using a singly linked list.
...
5
votes
2
answers
849
views
Bruteforce integer multiplication in Java
Intro
This time, I have attempted to prove the following bruteforce multiplication formula:
$$
(a_n \cdots a_0) \cdot (b_m \cdots b_0) = \sum_{i = 0}^n \sum_{j = 0}^m a_i b_j \cdot 10^{i + j},
$$
...
13
votes
5
answers
3k
views
Infinite precision integer in C++20
This is my infinite precision integer implemented in C++20. It supports negative numbers. I have implemented addition, subtraction, multiplication and binary integer division, which returns quotient ...
-4
votes
1
answer
393
views
int128 handling in C code, gcc / glibc / linux - follow up IV [closed]
[edit] Hint: a similar project for C++20 which - as far as I see - also manages bigger than 128-bit integers can be found at: Infinite precision integer in C++20 . [/edit]
I got lots of kind hints on ...
3
votes
3
answers
622
views
int128 handling in c-code, gcc / glibc / linux - follow up III
I got helpful reviews for first steps in:
int128 handling in c-code, gcc / glibc / linux,
int128 handling in c-code, gcc / glibc / linux - follow up and
int128 handling in c-code, gcc / glibc / linux -...
3
votes
1
answer
254
views
Int128 for handling large numbers bassed off of BigInteger update
An update to Int128 That is built on Linux for lack of direct support, based on System.Numerics Nuget package.
...
3
votes
2
answers
914
views
int128 handling in c-code, gcc / glibc / linux - follow up II
I got very nice reviews for an attempt to produce read and print
routines for 128-bit integer datatypes in:
int128 handling in c-code, gcc / glibc / linux and:
int128 handling in c-code, gcc / glibc / ...
4
votes
1
answer
249
views
Int128 for handling large numbers based off of BigInteger
I have created Int128 which is based off of BigInteger with operator overloading to handle larger math requirements. Here is a ...
5
votes
2
answers
415
views
int128 handling in c-code, gcc / glibc / linux - follow up
I had a draft for int128 handling reviewed there:
int128 handling in c-code, gcc / glibc / linux
I changed a lot according to the hints there, while leaving in, e.g.,
a trailing space on each line, ...
3
votes
0
answers
130
views
Comparing two Tree sort algorithm variations implemented in Java
I have this repository. It contains three variations of a simple sorting algorithm for integer keys.
The idea is that we keep a balanced BST in which each node holds the integer key and its frequency. ...
2
votes
1
answer
263
views
Pollard's rho algorithm implementation
I used std::multiset to determine how many times that factor appears.
I'd like to know if it can be improved; I've focused on the algorithm rather than the code.
...
2
votes
1
answer
186
views
What is the most efficient way to figure out if a single number is prime for numbers from 2 up to 2,147,483,647 in Java?
As Java programmers, we can always use the BigInteger isProbablePrime() method or store manually all prime numbers in a HashMap. This question is about the most efficient way to figure out if a single ...
6
votes
2
answers
333
views
Bit manipulation to find a monochromatic clique on k vertices knowing all on k-1 vertices
I have a very hot segment of code in a large project. I've extracted the relevant segment and a toy example to illustrate it.
The project involves an unavoidable combinatorial explosion related to ...
3
votes
2
answers
341
views
im2double and im2uint8 Functions Implementation for Image in C++
This is a follow-up question for conv2 Template Function Implementation for Image in C++ and An Updated Multi-dimensional Image Data Structure with Variadic Template Functions in C++. For performing ...