我正在使用JScience API编写单元,但我无法使用 pow 方法。如何为单位写 pow?
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