1. Where can I find documentation on the format to provide in a print command? I see that Console.OUT.print() takes a format and the variables, but using the basic C/Java style formats failed.
2. I'm trying to convert a long to a double. However, the only way I found was doing something like this:val longVal = 5;val doubleVal = Double.parseDouble(longVal.toString());There must be a simpler way to do this, but what is it?
Hi Chat,1. Where can I find documentation on the format to provide in a print command? I see that Console.OUT.print() takes a format and the variables, but using the basic C/Java style formats failed.Looks like you want printf(), not print(). Here is the documentation for x10.io.Printer, the type for Console.OUT: http://dist.codehaus.org/x10/xdoc/2.1.0/x10/io/Printer.html
2. I'm trying to convert a long to a double. However, the only way I found was doing something like this:val longVal = 5;val doubleVal = Double.parseDouble(longVal.toString());There must be a simpler way to do this, but what is it?Try this:val doubleVal = Double.fromLongBits(longVal)
2. I'm trying to convert a long to a double. However, the only way I found was doing something like this:val longVal = 5;val doubleVal = Double.parseDouble(longVal.toString());There must be a simpler way to do this, but what is it?Try this:val doubleVal = Double.fromLongBits(longVal)No go. Reading around, I feel like this is used to convert a binary string in long format to a IEEE double.