Questions tagged [unsigned-long-long-int]

unsigned long long int specified in the C99 standard

unsigned long long long int is at least 64-bit in size and was specified in the C99 standard. It is the same as long long but unsigned.

162 questions
2
votes
1 answer

Two -Wformat warnings (unknown conversion type & too many arguments for format)

#include int main() { unsigned long long int the_num = 600851475143; printf("%llu", the_num); return 0; } When I try to compile this, I get the following warnings: 3.c: In function 'main': 3.c:10:12: warning: unknown…
2
votes
1 answer

Any hope to convert a std::bitset<128> to a single 128-bit integer in the near future?

I am using std::bitset to represent short DNA sequences (haplotypes). For my purposes, I need to be able to convert each such sequence into a single integer. At the moment, it seems like this requirement bounds my sequences to be of length <=64…
gvbarroso
  • 21
  • 4
2
votes
0 answers

How to translate Python infinitely big integer into Cython?

I want to factorize very huge numbers (e.g. 100-bits, 200-bits numbers) with Cython. Hi everyone, I implemented the Elliptic Curve Method for factorization into Python 3.6. Now, I want to speed up my code using Cython (version 29.13). I'm a beginner…
G.F
  • 135
  • 10
2
votes
3 answers

problem in unsigned long long in c++

i have a cpp file say xyz.cpp, which contains long constants. now i need to change long constants to long long. ex long a=0x00000001 to long long a=0x0000000000000001 for future purpose. ( i use gcc compiler ) But when i do so, i got "integer…
2
votes
2 answers

Finding modulus with very large exponentiation and divisor in C

I need a function in C that calculates a^n mod q, where the divisor q is determined to be very big (15,383,399,235,709,406,497) and the exponent n may also be as large as that. Based on the property of modulo multiplication, that (a * b) mod n = ((a…
Namudon'tdie
  • 306
  • 1
  • 10
2
votes
1 answer

Unsigned Long Int overflow when calculating pow

I am trying to make a function that quickly calculates x^y mod z. It works well when calculating something like 2^63 mod 3, but at 2^64 mod 3 and higher exponents it just returns 0. I am suspecting an overflow somewhere, but I can't pin it down. I…
Ruza
  • 23
  • 3
2
votes
0 answers

C unsigned long long overflow on another in array

Let's say I've an array of unsigned long long, is there a way to put the overflow in the next ull? I want exact number so double aren't an option. For now this is what I have: #include unsigned long long d[2] = {1,0}, n[2] = {0,0}; //…
AdminXVII
  • 1,319
  • 11
  • 22
2
votes
5 answers

Arduino How can I print the unsigned long long data

I am trying to print unsigned long long data on Serial monitor but Serial.println() doesn't work because of not a string variable. So I searched on the internet to convert unsigned long long to String. I came up with some solutions but none of…
a-f-a
  • 147
  • 1
  • 3
  • 9
2
votes
1 answer

c++ usigned long long range vs mysql unsigned bigint range

I have a MySQL UDF that returns unsigned long long value. When i call this function in MySQL and the Data has been saved in database, MySQL returns warning: "BIGINT UNSIGNED value is out of range". How can i save large unsigned long long numbers in…
Ghasem Pahlavan
  • 661
  • 9
  • 20
2
votes
3 answers

Checking that String has a valid number

I'm a programming newbie and I'm currently writing a conversion calc program in objective c and I'm really struggling. I have a string representing a unsigned long long value. I need a way either when attempting to add another character to check…
2
votes
6 answers

Printing unsigned long long using %d

Why do I get -1 when I print the following? unsigned long long int largestIntegerInC = 18446744073709551615LL; printf ("largestIntegerInC = %d\n", largestIntegerInC); I know I should use llu instead of d, but why do I get -1 instead of…
user69514
  • 26,935
  • 59
  • 154
  • 188
2
votes
2 answers

c++ read char from file, convert to long long int

This is my function at the moment long long int File::Getline3(int user1, long long int user3) { std::string filename = std::to_string(user1); std::ifstream fin(filename + ".txt"); fin.getline (line1, 5); fin.getline (line2, 5); fin.getline (line3,…
user3001499
  • 811
  • 4
  • 16
  • 32
2
votes
2 answers

VBA very Long integer

I need to find a way to put a 19-digit integer (scale of 9 × 10^18) in a Word document. The problem is it needs to run on a 32-bit machine so the LongLong data type will not work. tried to split into a string array but that won't work either cause I…
Efratror
  • 31
  • 1
  • 3
2
votes
3 answers

Parse command line arguments as unsigned long long in C

I'm writing a C program that accepts a list of unsigned long long numbers as input from the command line. How do I parse them and store in an array? It seems that strtoull might help, but how do I use it? Here is my code: #include main…
1
vote
2 answers

Issue with converting String to unsigned long

I have a little problem with converting a char string array to an unsigned long. This is my input for executeCommand(). 0001000118218;326 And this is what i get back. Received command: 0001000118218;326 transmit code: 1821 transmit period: 32 I…
tomvda
  • 433
  • 1
  • 5
  • 17
1 2
3
10 11