Skip to main content
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more. View results.

Questions tagged [integer]

Use this tag for questions about using, storing or manipulating integral values of all types and sizes, including concerns about overflow. Not for code that casually happens to use integers.

Filter by
Sorted by
Tagged with
5 votes
2 answers
825 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}, $$ ...
coderodde's user avatar
  • 31k
14 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 ...
Ξένη Γήινος's user avatar
-5 votes
1 answer
354 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 ...
user1018684's user avatar
3 votes
3 answers
564 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 -...
user1018684's user avatar
3 votes
1 answer
199 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. ...
Short Int's user avatar
  • 595
3 votes
2 answers
836 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 / ...
user1018684's user avatar
4 votes
1 answer
203 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 ...
Short Int's user avatar
  • 595
5 votes
2 answers
380 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, ...
user1018684's user avatar
3 votes
0 answers
112 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. ...
coderodde's user avatar
  • 31k
2 votes
1 answer
238 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. ...
ozan's user avatar
  • 43
2 votes
1 answer
144 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 ...
user3595831's user avatar
6 votes
2 answers
298 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 ...
Dave's user avatar
  • 163
3 votes
2 answers
306 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 ...
JimmyHu's user avatar
  • 7,096
5 votes
0 answers
108 views

Dial's heap in Java for integer priority queues

(The entire project is here.) Intro I have this priority queue data structure for non-negative integer priority keys. I recall that it is called Dial's heap. Code Implementation ...
coderodde's user avatar
  • 31k
9 votes
3 answers
1k views

C function to read only numeric values

I'm learning C and as exercise I'm trying to implement a custom function to parse a input from user and return successfully only if the input is a number. These are my files, how could I improve it? ...
shark_sh's user avatar

15 30 50 per page
1
2 3 4 5
27