Questions tagged [long-long]

The `long long` size modifier was introduced in C++11 and can be used with integral types to select an integer of at least 64 bits.

See cppreference for more information.

131 questions
2
votes
0 answers

Facing undefined symbols linker issue with Diab compiler when I type cast array of data from float to long long

I wrote a small example code and executed in both GCC and DIAB compilers. #include int main() { float a[10]; long long int b[10]; int i; for (i =0;i<10;i++) { a[i] = 1.256*i; b[i] = (long long…
2
votes
0 answers

Cython division by long long causes Python crash

I have the following code in test.pyx cdef class Test: cdef long long i def __cinit__(self, long long i): self.i = i def __truediv__(Test self, Test other): return Test(self.i / other.i) In a short python script I have…
Mobious
  • 122
  • 8
2
votes
3 answers

Printing maximum values of INT

I try to print the maximum value of int in a program. Using the following code:: #include #include int main(void) { printf("%d",INT_MAX); return 0; } The output I get is:: 2147483647 But, when I change my printf…
user007
  • 2,156
  • 2
  • 20
  • 35
2
votes
1 answer

How to compare a long long with a double?

(This has to be a duplicate, but I can't find a duplicate...) How do I properly compare a long long with a double in C++? Casting either to the other can cause loss of precision and possibly overflow, so I'm not sure what to do...
user541686
  • 205,094
  • 128
  • 528
  • 886
2
votes
1 answer

Rounding issue when using long long on PIC

I'm doing a simple bit of maths on a PIC microcontroller, running code in C and using MPLABX and the xc16 compiler. This is the code: double mydouble = 0.019440; long long int mypower = 281474976710656; long long int result =…
edipo99
  • 37
  • 1
  • 4
2
votes
1 answer

How to declare an unsigned long long in Protobuf?

What is the right way to declare an unsigned LongLong (unsigned __int64) in Protobuf, so it would be used for both, Android and Windows? EDIT: I thought that I might need to use to variables, each holds a uint64, but I wasn't sure if this is the…
user844541
  • 2,868
  • 5
  • 32
  • 60
2
votes
2 answers

long long integer is not working in C(UNIX+AIX6.1)

I am using cc compiler on AIX 6.1 (Unix) #include int main() { long long var; scanf("%lld",&var); printf("%lld",var); return 0; } /* When I enter 16 digit number for above code its…
Shrirang Kumbhar
  • 363
  • 4
  • 17
1
vote
2 answers

assigning a value to a long long integers using gcc on sparc solaris

I came across something that I think rather strange. The test program int main(int argc, char* argv[]) { cout<<"hello"<
camelccc
  • 2,847
  • 8
  • 26
  • 52
1
vote
1 answer

Parse a string as a (long long) integer

I am writing a code in which I need to parse a string to a "long long int" I used to use atoi when changing from string to int, I dont think it still work. What Can I use now? --Thanks
Syntax_Error
  • 5,964
  • 15
  • 53
  • 73
1
vote
1 answer

Getting a negative answer after raising number to the power of x

I have this code that returns the answer after raising a number to an nth number. int getPower(int base, int x){ int result=1; while (x != 0) { result *= base; --x; } return result; } I tried testing out where base…
rinrin
  • 49
  • 5
1
vote
1 answer

compatibility 32bit-excel and 64-bit excel (office 365)

I am not experienced at vba so thank you for understanding. I tested some old macros in office 365, previously I worked with excel 2016. I read that some macros might not work properly because of the Long variable declaration. - As I understand…
1
vote
1 answer

How do I convert a long long into a string?

I am creating a program that takes a numerical input from the user as a long long, and then there is some maths involved with individual digits. I think the best way to do this is to convert the long long to a string and then iterate over the…
EdCase
  • 119
  • 2
  • 7
1
vote
2 answers

Why is "int" not working correctly with "j" but long long is working fine?

This is my code with int j: void solve(){ unsigned long long n; cin>>n; unsigned long long sum = 0; int j = 1; for(int i=3;i
1
vote
3 answers

Formatting Commas into a long long integer

this is my first time posting a question. I was hoping to get some help on a very old computer science assignment that I never got around to finishing. I'm no longer taking the class, just want to see how to solve this. Read in an integer (any valid…
soulgood
  • 11
  • 2
1
vote
1 answer

C++ reading csv into vector, getline() problem

My csv file data is look like this: Palmer Shannon,1.66805E+12,7500,3020 Jonas Kelley,1.62912E+12,9068,1496 Jacob Doyle,1.61608E+12,1112,3502 Iola Hayden,1.60603E+12,6826,4194 This is my header file : #ifndef client_h #define client_h #include…
1 2 3
8 9