I am using JScience API to write units, but I am not able use pow method. How to write pow for unit?
Unit<Length> centimeter = SI.CENTIMETER;
//Unit<Length> cm3 = centimeter.pow(3);eclipse suggests to add cast
Unit<Length> cm3 = (Unit<Length>) centimeter.pow(3);
System.out.println(cm3); // prints cm? instead of cm^3
I think it is a UTF-8 3-superscript?
See also here: http://www.fileformat.info/info/unicode/char/b3/index.htm
You can check it by analysing the bytes from
cm3.toString()
My output (using 3 superscript) of the next string:
If the first byte array has the same bytes as the second, the output is correct, but your console cannot display the character
³