diff options
Diffstat (limited to 'tests/errors/BoundaryNums.java')
-rw-r--r-- | tests/errors/BoundaryNums.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/errors/BoundaryNums.java b/tests/errors/BoundaryNums.java new file mode 100644 index 000000000..c5027d368 --- /dev/null +++ b/tests/errors/BoundaryNums.java @@ -0,0 +1,34 @@ +//Over-boundary base values cause compile-time errors +public class BoundaryNums { + public static void main(String[] args) { + byte minByte = -129; + byte maxByte = 128; + byte minByteHex = -0x81; + byte maxByteHex = 0x80; + + short minShort = -32769; + short maxShort = 32768; + short minShortHex = -0x8001; + short maxShortHex = 0x8000; + + char maxChar = 65536; + char maxCharHex = 0x10000; + char maxCharChar = '\u10000'; + + int minInt = -2147483649; + int maxInt = 2147483648; + int minIntHex = -0x80000001; + int maxIntHex = 0x80000000; + + long minLong = -9223372036854775810L; + long maxLong = 9223372036854775809L; + long minLongHex = -0x8000000000000001L; + long maxLongHex = 0x8000000000000000L; + + float minPosFloat = 1.0e-46f; + float maxPosFloat = 1.0e+39f; + + double minPosDouble = 1.0e-325; + double maxPosDouble = 1.0e+309; + } +} |