Questions tagged [long-integer]

A long integer is an integer number, typically twice the size of a standard integer. It is represented by the keyword 'long' in several programming languages.

A long integer is an integer number, typically twice the size of a standard integer. It is represented by the keyword 'long' in several programming languages.

http://en.wikipedia.org/wiki/Integer_(computer_science)#Long_integer

2408 questions
0
votes
1 answer

program to convert decimal to binary is not working for large outputs

I made a program to convert decimal to binary but it is not working for big outputs. I think I am not able to use long long int in my function properly. Here is my code: #include using namespace std; int decimal_to_binary(int n) { …
user15873758
0
votes
0 answers

My unsigned long long int return 0, help me

#include unsigned long long int factorial(unsigned long long int n); int main(void){ unsigned long long int n; int t; scanf("%d", &t); for(int i = 0; i < t; i++){ scanf("%lld", &n); long int a =…
0
votes
0 answers

python3 bit shift more than 64 times

I have a trouble to make a function that may shift a bit more than 64 sites. I'm making an mapping and inverse mapping function on an array table. I fill the table with numbers having only two 1 bits in ascending order. The mapping function…
0
votes
1 answer

ASP.NET Variable issues

I have some terribly written ASP.NET code that is just not working right (go figure). I'm charged with maintaining and bug fixing this code, but I can barely make head or high water of it Unfortunately I don't have the time to rewrite it. If someone…
matthewdunnam
  • 1,656
  • 2
  • 19
  • 34
0
votes
2 answers

I'm getting the value of b as 2130 can anyone explain me the process and tell me why?

public class Main { public static void main(String[] args) { byte x = 126; short y = 32734; int z = 32789; long a = 50000L + 10L * (x + y + z); System.out.println(a); short b = (short) (1000 + 10 * (x + y + z)); …
0
votes
0 answers

Why Long number in typescript has a wrong value?

I have number: const lngNumber: number = 44495442002226675; console.log(lngNumber); // ->gives me 44495442002226670 I have no idea why? Btw, this is api response. Somehow the browser does not know how to display this but Postman does. UPDATE Raw…
pregmatch
  • 2,629
  • 6
  • 31
  • 68
0
votes
3 answers

Converting CURRENCY to a long

How can I convert CURRENCY type to a long type? I need to be able to do this because I want to put the value of the CURRENCY type into a sprintf using %d I'm having a hard time with this one, help is appreciated :)
Skizz
  • 37
  • 1
  • 4
0
votes
1 answer

InputMismatchException in a scanner to get data from txt file

I'm trying to read the highscores of a game from a txt file and put them into an array so that another section of the program can detect a high score. Earlier I had everything declared as Int and it worked fine but I wanted more precision so I…
0
votes
1 answer

Does Endian-ness affect the union members when they are integers?

union Chunk { struct { uint32_t index, total; } m_; uint64_t m_PlaceHolder; } chunk; chunk.m_.index = 1; chunk.m_.total = 2; SendOverTCPNetwork(chunk.m_PlaceHolder); // different platform OS will receive this A union member is set for 2…
iammilind
  • 68,093
  • 33
  • 169
  • 336
0
votes
1 answer

compound subtraction in Java with different datatypes

I am confused about datatype conversion in Java. Why does this code work: long q = 5; long r = 4; int p = 0; p -= q * r; while the code below gives a compile error? Type mismatch: cannot convert from long to int long q = 5; long r = 4; int p =…
Ufder
  • 527
  • 4
  • 20
0
votes
1 answer

Unexpected outputs are coming by only changing the data type

unsigned long long int s=0; s=191689628 +646033877 +109099622 +798412961 +767677318+ 190145527 +199698411; cout<
0
votes
1 answer

How to convert long value difference of two time to seconds?

How to convert long value difference of two time to seconds? Example: Insert Time is 2021-07-28 13:22:05.742906 -> Epoch Value 1627459467906 Update Time is 2021-07-28 13:22:17.779218 -> Epoch Value 1627459516218 Difference between Insert and Update…
harry
  • 1
0
votes
2 answers

Converting from unsigned long int to signed int and vice versa

I would like to pass a signed int to gsl_rng_uniform_int (const gsl_rng * r, unsigned long int n). The signed int that I'm passing is greater than or equal to zero. The function will return a number between 0 and n, so if I pass it a positive signed…
mshang
  • 955
  • 4
  • 11
  • 18
0
votes
2 answers

Pointer Arithmetic long and short in 32bit or 64bit System

I am just studying for an exam and the following question is asked, what output does the following program generate in 32 bit or 64 bit? #include int main(int argc, char **argv) { long *p = (long *)8; short *q = (short *)0; int c, i,…
Joe Daniel
  • 41
  • 1
  • 7
0
votes
2 answers

where should I use ULL in after variables?

I was trying to solve a question on codeforces . I have to give input 1000000000 1000000000 1 to this code #include using namespace std; int main() { long n,m,a; cin >> n >> m >>a ; long b,c; b = (n%a==0)?(n/a):((n/a)+1); c =…