[resolved] more long longs

Write here if you have problems with your C++ source code

Moderator: Board moderators

Post Reply
Experienced poster
Posts: 147
Joined: Fri Jun 13, 2003 10:46 pm

[resolved] more long longs

Post by bugzpodder »

i tried to use bitshifting for my long long variable but it wont take width of greater than 31
my compiler complains for something like:
long long x;
Last edited by bugzpodder on Mon Sep 29, 2003 3:09 am, edited 1 time in total.

Viktoras Jucikas
New poster
Posts: 22
Joined: Sun Oct 20, 2002 6:41 pm
Location: Lithuania

Post by Viktoras Jucikas »

Obviously, numeric constants are treated as int by default (afaik) so this 1 is nothing more than 32bits (on most systems). Add LL to get long long.
[cpp]long long x;
x = 1LL << 42;

Post Reply

Return to “C++”