Created
September 2, 2017 06:06
-
-
Save alexcrichton/cfadf366b00f7ca9a78ddc6c1fb1437d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.lang.*; | |
import java.io.*; | |
class Ideone | |
{ | |
public static void main (String[] args) throws java.lang.Exception | |
{ | |
System.out.format(" 257.0 -> i32 = %d\n", (int) 257.0); | |
System.out.format("-257.0 -> i32 = %d\n", (int) -257.0); | |
System.out.format(" MAX+1 -> i32 = %d\n", (int) 2147483648.0); | |
System.out.format(" MIN-1 -> i32 = %d\n", (int) -2147483649.0); | |
System.out.format("-0.0 -> i32 = %d\n", (int) -0.0); | |
System.out.format(" Inf -> i32 = %d\n", (int) (1.0/0.0)); | |
System.out.format("-Inf -> i32 = %d\n", (int) (-1.0/0.0)); | |
System.out.format(" NaN -> i32 = %d\n", (int) (0.0/0.0)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment