how do you write java ```0x1p10``` in kotlin?
# announcements
j
how do you write java
Copy code
0x1p10
in kotlin?
o
How would you write it in java?
j
e.g.:
Copy code
double x = 0x1p10;
it's basically e but ensuring that it does not clash with hex
o
Might not be what ur looking for but
val x = 1024.0
would be equal right?
j
i believe you're correct
m
Wow, I've never seen that p-syntax
o
Me neither 😅
e
Kotlin does not support this syntax. Convert it to a regular (decimal) notation.
j
trying thanks 😄
on side-note java:
double x = 0x1p10; // 1024.0
double y = 0x1e10; // 7696.0
e
That’s not how you convert 😄 Just do
System.out.println(0x1p10)
in Java to see its value in decimal notation.
👍 1
o
You could do
Cmd+Shift+A
and search for
Convert to decimal
while selecting the hex value 🙂
👍 1
j
cool didn't know that one