Questions tagged [int64]

The int is a datatype that represents an integer and is coded on 64 bits in memory.

int64 is a datatype that represents an (a whole number, not a fraction) and is coded on 64 bits in memory. Unlike its counterpart which is , int64 can be used to store positive and negative integers of values between -263 to 263 - 1.

260 questions
8
votes
1 answer

64 bit integers and older C++ compilers

I want to use 64 bit integers in my C++ code. I understand I can either #include and then declare a uint64_t or use unsigned long long (or the equivalent for signed versions). However, it appears that support for this was not added until…
Simd
  • 19,447
  • 42
  • 136
  • 271
8
votes
2 answers

Golang overflows int64

I try to use this code, but gives me an error: constant 100000000000000000000000 overflows int64 How can I fix that ? // Initialise big numbers with small numbers count, one := big.NewInt(100000000000000000000000), big.NewInt(1)
Mad
  • 101
  • 1
  • 6
8
votes
2 answers

How to change System.DirectoryEntry "uSNChanged" attribute value to an Int64

I'm trying to get the Int64 value of a Directory Services object's "uSNChanged" value. Unfortunately, it is always coming back as a COM object of some kind. I've tried using casting to Int64, calling Int64.Parse(), and calling Convert.ToInt64().…
Simon Gillbee
  • 3,932
  • 4
  • 35
  • 48
7
votes
2 answers

Why do my .net Int64's behaves as if they were Int32's?

I'm witnessing a strange behavior in a .net program : Console.WriteLine(Int64.MaxValue.ToString()); // displays 9223372036854775807, which is 2^63-1, as expected Int64 a = 256*256*256*127; // ok Int64 a = 256*256*256*128; // compile time error :…
Brann
  • 31,689
  • 32
  • 113
  • 162
7
votes
3 answers

__int64 to CString returns wrong values - C++ MFC

I want to convert a __int64 variable into a CString. The code is exactly this __int64 i64TotalGB; CString totalSpace; i64TotalGB = 150; printf("disk space: %I64d GB\n", i64TotalGB); totalSpace.Format(_T("%I64d", i64TotalGB)); printf("totalSpace…
Luca Corsini
  • 738
  • 4
  • 20
7
votes
4 answers

Byte Array to Uint64 as a String

Let's think about the following situation. The Go routine creates a byte array where packs a Uint64 number 5577006791947779410 in 8 bytes Big Endian [77, 101, 130, 33, 7, 252, 253, 82]. In JavaScript code I receive these bytes as Uint8Array. We know…
VisioN
  • 143,310
  • 32
  • 282
  • 281
7
votes
2 answers

Bit-shifting with Int64

An Int64 variable needs to be shifted. I am parsing pseudo mathematical functions from a database file. The Variables are uint32 or int32 so i did put them into an Int64 to handle them equally without loosing anything. In one of my treenodes i need…
Johannes
  • 6,490
  • 10
  • 59
  • 108
6
votes
3 answers

Why can't I directly set an __int64 variable to -2500000000?

This program is written in VC++ 6.0 on a WindowsXP machine. If I try to set an __int64 variable to -2500000000 directly, it is truncated to a 32bit value and the two's complement is taken. __int64 testval; testval = -2500000000; At this point…
E.Freitas
  • 542
  • 1
  • 4
  • 18
6
votes
4 answers

Why "unsigned int64_t" gives an error in C?

Why the following program gives an error? #include int main() { unsigned int64_t i = 12; printf("%lld\n", i); return 0; } Error: In function 'main': 5:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'i' …
msc
  • 33,420
  • 29
  • 119
  • 214
6
votes
4 answers

Mismatching types 'Int64' and '_' when trying to assign optional Int64 to a dictionary key

Question regarding Swift 2.1 in Xcode 7. I have declared an optional variable like this: var something: Int64? I would like to later assign it to a dictionary key using a shorthand if, like this: dictionary['something'] = (something != nil) ?…
Tarps
  • 1,928
  • 1
  • 11
  • 27
6
votes
2 answers

Swift - Cast Int64 to AnyObject for NSMutableArray

Hi I have a NSMutableArray and I try this: var ma = NSMutableArray() let number:Int64 = 8345834344 ma.addObject(number)// Error "Type Int64 does not conform to protocol AnyObject" How to add Int64 variable to NSMutableArray() ?
Bogdan Bogdanov
  • 882
  • 11
  • 36
  • 79
6
votes
1 answer

Definition of large integer value

I have a project where I deal with large numbers (ns-timestamps) that don't fit in an integer. I therefore want to to use e.g. int64_t and am currently writing a test case (yes!). To check the behaviour for large number, i started with something…
FooTheBar
  • 818
  • 1
  • 9
  • 20
5
votes
1 answer

TypeError: Object of type int64 is not JSON serializable | pandas aggregation functions and json.dumps() error

Pandas aggregation functions return TypeError: Object of type int64 is not JSON serializable. Here is the dataframe: d = {'col1': [1, 2], 'col2': [3, 4]} df = pd.DataFrame(data=d) df Out[47]: col1 col2 0 1 3 1 2 4 Here is how I…
Shilp Thapak
  • 331
  • 6
  • 14
5
votes
1 answer

as.integer() on an int64 dataframe produces unexpected result

I was reviewing some code and came across this odd result. If you have a dataframe with one value of type integer and you coerce it to integer you get what I think you would expect: library(dplyr) tibble(x = as.integer(c(1))) %>% as.integer() [1]…
Ben G
  • 4,148
  • 2
  • 22
  • 42
5
votes
3 answers

Cannot convert value of type 'Int64?' to expected argument type 'Int'

When I try to pass job?.id (an Int64) as Int parameter ( while I know it's not that big ), swift compiler prompts with this error, I tried a couple of ways to cast it, but had no success : Cannot convert value of type 'Int64?' to expected argument…
AVEbrahimi
  • 17,993
  • 23
  • 107
  • 210
1 2
3
17 18