long

How is 64-bit math accomplished on a 32-bit machine?

If a 32-bit processor is, indeed, really only 32 bits in length, then how can math operations work on 64-bit numbers? For example: long lngTemp1 = 123456789123; long lngTemp2 = lngTemp1 * 123; According to MSDN, a long in C# is a signed 64-bit number: http://msdn.microsoft.com/en-us/library/ctetwysk(VS.71).aspx How is it that a 32-bi...

How to printf "unsigned long" in C?

I can never understand how to print unsigned long datatype in C. Suppose boo is an unsigned long, then I try: printf("%lu\n", unsigned_boo) printf("%du\n", unsigned_boo) printf("%ud\n", unsigned_boo) printf("%ll\n", unsigned_boo) printf("%ld\n", unsigned_boo) printf("%dl\n", unsigned_boo) And all of them print some kind of -12312312...

Long Touch on a surfaceView ( android )

Hi! I'm making a game on Android and I need to do certain actions when the users attempts a long press on the screen. Unfortunately I haven't found any methods that works directly with a custom SurfaceView, feel free to tell me if such a method exists :) So I decided to try and implement a long touch detection from the onTouch event li...

C++ variant for Java long?

Is there a C++ variant for the long primitive data-type? A C++ long is only 4 bytes, while a Java long is 8 bytes. So: Is there a non-decimal primitive type with a size of 8 bytes in C++? Maybe with some tricks? Thanks ...

Why cant the compiler infer that a large number is a long?

This compiles var fourGb = (long)4*1024*1024*1024; But this fails var fourGb = 4*1024*1024*1024; With "The operation overflows at compile time in checked mode". So if the compiler knows this will be an overflow why cant it infer that the variable type should be a long? ...

Long UNC path not working in CMD.EXE on remote machine

Hi, I am trying to connect to a remote server using Plink tool. Both my local and remote machines are Windows. On remote server, I have OpenSSH server installed. I am able to run commands on remote machine but there is some problem with long UNC path, which I noticed today. For example, Working: Plink -ssh -pw xxx user@server cmd.e...

difference between "long" and "long int", abs & labs

This is probably just an inconsistency of notation at cplusplus.com, but is there a difference between "long int" and "long" types in C++? cplusplus.com says that abs takes inputs of types "int" and "long", whereas labs uses "long int". I assume that this is basically a typo. If so, then is the only difference between abs and labs tha...

Data types in C

A long double is known to use 80 bits. 2^80 = 1208925819614629174706176; Why, when declaring a variable such as: long double a = 1208925819614629174706175; // 2^80 - 1 I get a warning saying: Integer constant is too large for its type. ...

php convert floating point to long (convert to string to pass to a xml function)

Hi, PHP converts a large number to floating point which I need in "long" format to pass to a soap xml api. ((round(time()/(60*15))*60*15)+(30*60))*1000 This gives the result: 1.28E+12 Whereas, what I need is: "1280495700000" in order to pass to the api ...

CUDA float to long long conversion and texture read giving incorrect result.

I would ask this in the CUDA forums but for some reason I can't get past the first page the registration, so here goes: nVidia Card: 9800 GT CUDA toolkit 3.0 Compiled for: compute capability 1.1 Scenario 1: float result = 0; float f1 = tex2D( tex, u, v ); float f2 = tex2D( tex, u + 1; v + 1 ); long long ll1 = __float2ll_rn...

Problem with LONG in Oracle

hi, i have an old oracle database in which there is a field of type LONG(max size is 2GB) Now earlier it used to work fine but with time data we started putting was of size much more than 2GB so we started facing trouble. I can not change the field type from LONG to CLOB since that will create a lot of trouble as innumerable changes ...

How to add long value to calendar?

Calendar's add method in Java takes an integer as an input int secs = 3; cal.add(Calendar.SECOND, secs); But what if the seconds are Long type. long secs = 3 There's quite a few possibilities like adding the seconds iterative, but what are the other options? ...

Find long (>255) filenames

There are some folder with more than 100 files on it. But all files and folders names broken with wrong encoding names (UTF->ANSI). "C:\...\Госдача-Лечебни корпус\вертолетка\Госдача-Лечебни корпус\Госдача-Лечебни корпус\вертолетка\Госдача-Лечебн...

What can I use in place of a "long" that could be cloneable?

What can I use in place of a "long" that could be cloneable? Refer below to the code for which I'm getting an error here as long is not cloneable. public static CloneableDictionary<string, long> returnValues = new CloneableDictionary<string, long>(); EDIT: I forgot to mention I was wanting to use the following code that I found (see ...

maximum float in python

Hi, I think the maximum integer in python is available by calling sys.maxint, whereas the maximum float or long, what is it? ...

How to convert a binary file into a Long integer?

In python, long integers have an unlimited range. Is there a simple way to convert a binary file (e.g., a photo) into a single long integer? ...

Erlang long 64 number BUG

Erlang is truncating the value of big long operations if one of the operands are not big enough. Although it is not truncating if both operands are big enough. 199> 3656626623097354252900000 * 11111111111111111111111111. 40629184701081713921111110704819264100293971900000 200> 3656626623097354252900000 * 64. 2340241...

How to generate a UUID of type long (to be consumed by a java program) in Python?

How do you generate UUID of type long (64 bits - to be consumed by a java program) using Python? I read about the UUID module. So I played with it a bit: >>> import uuid >>> uuid.uuid1().int 315596929882403038588122750660996915734L Why is there an "L" at the end of the integer generated by uuid.uuid1().int? If it's an integer should...

Getting Current Date Time for a Random Number Generator's Seed

Preferably as a long. All the example I can find are getting the date/time as a string and not any scalar value. :) ...

Android OnLongClickListener strange / unreliable behaviour

Hi there :) I'm currently fighting against the OnLongClickListener on Android Api Lvl 8. Take this code: this.webView.setOnLongClickListener(new OnLongClickListener() { @Override public boolean onLongClick(View v) { System.out.println("long click"); return true; } }); It works perfectly. I can press anywh...