diff options
author | Camil Staps | 2015-03-17 18:45:26 +0100 |
---|---|---|
committer | Camil Staps | 2015-03-17 18:45:26 +0100 |
commit | 4e7d3754b69f6af8f84622a17d28103ce70021d1 (patch) | |
tree | 0692608903feb6111eafe8a8583795c7b82ae847 /Week7/src/polynomial/Term.java | |
parent | Week 7 framework + startzip (diff) |
Implementation with limited tests; no javadoc yet
Diffstat (limited to 'Week7/src/polynomial/Term.java')
-rw-r--r-- | Week7/src/polynomial/Term.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Week7/src/polynomial/Term.java b/Week7/src/polynomial/Term.java index 67bcf04..b8d9f16 100644 --- a/Week7/src/polynomial/Term.java +++ b/Week7/src/polynomial/Term.java @@ -105,6 +105,10 @@ public class Term { && coefficient == term.coefficient; } } + + public double apply(double x) { + return coefficient * Math.pow(x, exponent); + } /** * A static method for converting scanner input into a term. The expected |