diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2015-11-17 16:03:48 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2015-11-17 16:03:48 +0100 |
commit | dc30f414e08e3df442824b4e4fb57b8ae4f14b18 (patch) | |
tree | eca93d739023670ebf8855d9829339f7816a3cb1 /ws2015 | |
parent | 34c8e0fa840f67ac18fbbd345196ef342dee06c6 (diff) | |
download | uni-dc30f414e08e3df442824b4e4fb57b8ae4f14b18.tar uni-dc30f414e08e3df442824b4e4fb57b8ae4f14b18.tar.gz uni-dc30f414e08e3df442824b4e4fb57b8ae4f14b18.tar.bz2 uni-dc30f414e08e3df442824b4e4fb57b8ae4f14b18.tar.xz uni-dc30f414e08e3df442824b4e4fb57b8ae4f14b18.zip |
rounding fix
Diffstat (limited to 'ws2015')
-rw-r--r-- | ws2015/eip/blaetter/04/Schleife.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ws2015/eip/blaetter/04/Schleife.java b/ws2015/eip/blaetter/04/Schleife.java index a693cb0..09c10fb 100644 --- a/ws2015/eip/blaetter/04/Schleife.java +++ b/ws2015/eip/blaetter/04/Schleife.java | |||
@@ -28,8 +28,8 @@ public class Schleife { | |||
28 | } | 28 | } |
29 | 29 | ||
30 | private static double f(int x, int y) { | 30 | private static double f(int x, int y) { |
31 | double xprime = (x - 200) / 120; | 31 | double xprime = (x - 200) / 120.0; |
32 | double yprime = (200 - y) / 100; | 32 | double yprime = (200 - y) / 100.0; |
33 | return Math.pow(xprime * xprime + yprime * yprime - 1, 3) - (xprime * xprime * yprime * yprime * yprime); | 33 | return Math.pow(xprime * xprime + yprime * yprime - 1, 3) - (xprime * xprime * yprime * yprime * yprime); |
34 | // pow is comparatively expensive (at least it would be if this were C ;) ) | 34 | // pow is comparatively expensive (at least it would be if this were C ;) ) |
35 | } | 35 | } |