Jump to content

How to 0xFFFFFFFFL to long long??


Recommended Posts

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

You want to cast hexadecimal to long long ?

51 minutes ago, Krusty said:

..

 

    long long x;   
    std::stringstream ss;
    ss << std::hex << "0xFFFFFFFFL";
    ss >> x;

    std::cout << static_cast<long long>(x) << std::endl;

 

http://rextester.com/KYJ25270 Live compile and test.

Will produce the following result :

4294967295

 

Link to comment
Share on other sites

36 minutes ago, 127.0.0.1 said:

You want to cast hexadecimal to long long ?

 


    long long x;   
    std::stringstream ss;
    ss << std::hex << "0xFFFFFFFFL";
    ss >> x;

    std::cout << static_cast<long long>(x) << std::endl;

 

http://rextester.com/KYJ25270 Live compile and test.

Will produce the following result :


4294967295

 

 I want to increase exp, and my python doesnt work... i can use only exp for 4kkk or something like that after 4kkk i have only 200kk exp for next level

Link to comment
Share on other sites

You could use ctypes.c_longlong:

 

>>> from ctypes import c_longlong as int64_t
>>> int64_t(2 ** 63 - 1)
c_longlong(9223372036854775807L)
>>> int64_t(2 ** 63)
c_longlong(-9223372036854775808L)
>>> int64_t(2 ** 63).value
-9223372036854775808L

 

Add this import

from ctypes import c_longlong as int64_t

Python usage exmple :

	if (int64_t(text) <= 0):
		return True

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.