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.

151 questions
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
  • 187
  • 9
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
1 answer

How to change from negative number to zero in Swift

I have Double data type, cause I need result with floating number, but if my result is negative, it broke all my algorithm. Is there maybe a unsigned data type with floating point?
netatmoBench
  • 55
  • 1
  • 8
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,224
  • 14
  • 20
2
votes
3 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
  • 129
  • 1
  • 1
  • 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
  • 581
  • 6
  • 19
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
  • 24,321
  • 56
  • 146
  • 183
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
  • 721
  • 2
  • 13
  • 31
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
  • 21
  • 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…
NightWalker
  • 421
  • 1
  • 5
  • 17
1
vote
3 answers

'unsigned long int', and 'unsigned long long int' assignment issue

A few weeks ago, I was using for first time (I'm not used to use them) floats, doubles, and I have some problems with the comparison operand. I also have had problems while trying to assign values to that types, but I've solved it as well... Today,…
shura-astrozero
  • 165
  • 2
  • 10
1
vote
1 answer

unexpected integer returned from a C function by calling it using ctypes

I wrote following C function: unsigned long long int myfunction(unsigned long long int number) { return number; } and after making a shared library I want to calling it from python: from pathlib import Path from ctypes import CDLL,…
1 2
3
10 11