Skip to content

Instantly share code, notes, and snippets.

@inklesspen
Created September 21, 2010 04:12
Show Gist options
  • Select an option

  • Save inklesspen/589176 to your computer and use it in GitHub Desktop.

Select an option

Save inklesspen/589176 to your computer and use it in GitHub Desktop.
package com.inklesspen.firejam;
public class IntTypes {
public static void main(String[] args) {
long a = 4294967285L;
System.out.println(a);
int b = (int) a;
System.out.println(b);
int c = b + 100;
System.out.println(c);
long d = (a + 100) & 0xFFFFFFFFL;
System.out.println(d);
}
}
/*
Output:
4294967285
-11
89
89
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment