From b6772c5fb14ae98f8955b60cc6c20314ceafbe35 Mon Sep 17 00:00:00 2001 From: Abhijay Kumar Date: Wed, 22 May 2019 12:49:33 +0530 Subject: [PATCH] Cast the second operand of Math.pow to double --- src/main/java/com/generation/SimplexNoise.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/generation/SimplexNoise.java b/src/main/java/com/generation/SimplexNoise.java index a4fcb3f1..485a55b2 100644 --- a/src/main/java/com/generation/SimplexNoise.java +++ b/src/main/java/com/generation/SimplexNoise.java @@ -36,7 +36,7 @@ public class SimplexNoise { this.octaves[index] = new SimplexNoiseOctave(random.nextInt()); 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 { for (int index = 0; index < this.octaves.length; 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; }