New J2K: add conversion of binary literals & fix conversion of octal ones

#KT-32835 fixed
This commit is contained in:
Ilya Kirillov
2019-07-24 23:39:56 +03:00
parent 72a09ab59b
commit e795e4b73d
6 changed files with 45 additions and 14 deletions
+8
View File
@@ -0,0 +1,8 @@
public class Binary {
int negativeBinaryInt = 0b10111111111111111111111111111111;
int binaryInt = 0b10111111111;
long negativeBinaryLong = 0b1011111111111111111111111111111111111111111111111111111111111111L;
long binaryLong = 0b1011111111111111111L;
short binaryShort = 0b111111111111111;
byte binaryByte = 0b1010011;
}
+8
View File
@@ -0,0 +1,8 @@
class Binary {
internal var negativeBinaryInt = -1073741825
internal var binaryInt = 1535
internal var negativeBinaryLong = -4611686018427387905L
internal var binaryLong = 393215L
internal var binaryShort: Short = 32767
internal var binaryByte: Byte = 83
}
+6 -5
View File
@@ -1,7 +1,8 @@
//file
class Test {
void test() {
int i1 = 045;
Int i2 = 032;
}
int negativeOctalInt = 023432423432;
int octalInt = 07432423432;
long negativeOctalLong = 01777777777777777777777L;
long octalLong = 0777777777777777777777L;
short octalShort = 047777;
byte octalByte = 077;
}
+6 -4
View File
@@ -1,6 +1,8 @@
internal class Test {
fun test() {
val i1 = 37
val i2 = 26
}
var negativeOctalInt = -1670764774
var octalInt = 1013589786
var negativeOctalLong = -1L
var octalLong = 9223372036854775807L
var octalShort: Short = 20479
var octalByte: Byte = 63
}