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

Multiply 64b x 32b divide by 64b integers

What is the fastest and cross platform/compiler (GCC and MSVC) way to multiply 64b x 32b divide by 64b integers like: uint64_t counter; uint32_t resolution = NANOS_IN_SEC; // NANOS_IN_SEC = 1000000000 uint64_t freq; uint64_t res = (counter *…
mvorisek
  • 3,290
  • 2
  • 18
  • 53
0
votes
1 answer

Converting String To Long in CSharp and Java

I am trying to convert a string into a numerical value in c# and java, with the condition that the conversion must be equal. The following Java - Test runs: import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; import…
Stephan
  • 1,639
  • 3
  • 15
  • 26
0
votes
2 answers

overflow warnings for long to integer conversions after updating to 64 bit java

We have a method to convert the date in milliseconds in long format to byte array so that we can send it to network. We were using below method to convert from long to byte in java. But our java was 32 bit, and thus we were converting the long to…
Onki
  • 1,879
  • 6
  • 38
  • 58
0
votes
2 answers

C code exponential calculation is giving wrong result

for int value 2,015,671 this code outputs 475,739,751 long long cube(int n) { return n*n*n; } While the correct value should be 8,189,529,329,933,957,120 but using the pow(n, 3) from I got the correct result. If it is an overflow of long…
nga1hte
  • 13
  • 2
0
votes
0 answers

Long query with outer join,

I have a long query which is basically consist of two sections as…
omid
  • 21
  • 4
0
votes
2 answers

Unable to calculate factorial , getting output as 0 in C

Tried calculating factorial of 65, got correct output. Anything greater than 65 results in output of 0. Shocking since I'm using unsigned long int. What is amiss ? Code: #include void factorial(int unsigned long); int main() { int…
user13863346
  • 327
  • 2
  • 11
0
votes
1 answer

Im trying to do Luhn's algorith to check on valid credit cards, but i cant get to sum the numbers

Im trying to get the sum with Luhn's algorithm with this credit card number: 4003600000000014 I'm getting this output: Sum single numbers: 4195600 Multiplied numbers: 0 I'm trying to get 13 and 7... Appreciate some help! #include int…
0
votes
3 answers

Iterate a long integer and then append number to an array in C

So I'm prompting the user for a number, stored as a long int, then I want to do a for loop and iterate that long int, getting all the odd position numbers in a odd array and all the even position numbers in a even array. I'm trying to resolve the…
0
votes
1 answer

IAR can't make long line(80th)

I used the code below. The IAR code screen has a vertical line after the 80th. In the code below, there is a vertical line before the "src" variable. __STATIC_INLINE void orderedCpy(volatile uint32_t* dst, const uint32_t* __RESTRICT src, uint32_t…
delisting
  • 9
  • 3
0
votes
1 answer

Modulo in order to get single int from long

C language question. My task is to get second to the last, third to the last digit etc. from a long. Got a hint to do it by using modulo operator: int main(void) { a = get_long("n:\n"); mod = a % 10; printf("%i", mod); } Works…
piotrektnw
  • 120
  • 7
0
votes
0 answers

How to convert hex(base16) value of hash SHA-256 to Unsigned Integer(7) (base10) in Scala?

Logic which is working in Abinitio platform. Lets take sample value as “123456789”, for which we need to generate SHA256 and convert into unsigned integer(7). Expected result - 40876285344408085 m_eval 'hash_SHA256("123456789")' [void 0x15 0xe2…
Smahato
  • 1
  • 1
0
votes
4 answers

How to find the length(number of digits)of a long in C?

This is the code prompting the user for input #include #include //prompt user for number int main(void) { long number = get_long("Enter card number: "); }
mhashir23
  • 23
  • 1
  • 2
0
votes
1 answer

Long only allows 10^9 on scalafiddle

Problem Statement: Scala.Long should handle positive Integers to 9223372036854775807 however scalafiddle.io only allows integers on the order of…
Jim
  • 1
  • 2
0
votes
1 answer

Easy way to show Decimal of Long via CountDownTimer - Android

I have working code but it seems a bit strange that I have to gimmick my way around showing a decimal place on CountDownTimer but I haven't found anything that does it easier (obviously). Here is the working Code I currently have: final String…
Toclmi
  • 99
  • 2
  • 13
0
votes
1 answer

How to do a string to long int?

I want to create a function to take a string like this "2014-02-13T06:20:00" and to convert to a long long int like 20140213062000. Has anyone a idea how this can be done?
user1555
  • 23
  • 4
1 2 3
99
100