Math “pow” in Java and C# return slightly different results?
问题 I am porting program from C# to java. I've faced a fact that Java Math.pow(0.392156862745098,1./3.) = 0.7319587495200227 C# Math.Pow( 0.392156862745098, 1.0 / 3.0) =0.73195874952002271 this last digit leads to sufficient differences in further calculations. Is there any way to emulate c#'s pow? Thanx 回答1: Just to confirm what Chris Shain wrote, I get the same binary values: // Java public class Test { public static void main(String[] args) { double input = 0.392156862745098; double pow = Math