提交 b6772c5f 编写于 作者: A Abhijay Kumar

Cast the second operand of Math.pow to double

上级 132060f0
...@@ -36,7 +36,7 @@ public class SimplexNoise { ...@@ -36,7 +36,7 @@ public class SimplexNoise {
this.octaves[index] = new SimplexNoiseOctave(random.nextInt()); this.octaves[index] = new SimplexNoiseOctave(random.nextInt());
this.frequencys[index] = Math.pow(2, index); this.frequencys[index] = Math.pow(2, index);
this.amplitudes[index] = Math.pow(persistence, octaveCount - index); this.amplitudes[index] = Math.pow(persistence, (double)octaveCount - index);
} }
} }
...@@ -103,7 +103,7 @@ public class SimplexNoise { ...@@ -103,7 +103,7 @@ public class SimplexNoise {
for (int index = 0; index < this.octaves.length; index++) { for (int index = 0; index < this.octaves.length; index++) {
double frequency = Math.pow(2, index); double frequency = Math.pow(2, index);
double amplitude = Math.pow(this.persistance, this.octaves.length - index); double amplitude = Math.pow(this.persistance, (double)this.octaves.length - index);
result += this.octaves[index].noise(x / frequency, y / frequency, z / frequency) * amplitude; result += this.octaves[index].noise(x / frequency, y / frequency, z / frequency) * amplitude;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册