diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2010-11-29 16:13:07 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2010-11-29 16:13:07 -0500 |
commit | d2f97f27451ecb2a9a38ec95c27ffe3cde260651 (patch) | |
tree | c66537759cd15c9a2ca5e2fe031410a06153b44b | |
parent | 9a68dbea3ce813ead95b3b4b3ceb2542bc5ca670 (diff) |
Bugfix: use fabs() instead of abs()wip-aedzl-revised
The triangular waveform in rtspin.c used integer's abs() instead of
floating-point's fabs(). This resulted in incorrect waveforms.
-rw-r--r-- | bin/rtspin.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/rtspin.c b/bin/rtspin.c index 939d507..0995d01 100644 --- a/bin/rtspin.c +++ b/bin/rtspin.c | |||
@@ -186,7 +186,7 @@ double tri_wave(int count, struct wave_data* w) | |||
186 | { | 186 | { |
187 | double step = count % w->period; | 187 | double step = count % w->period; |
188 | double v = 2.0 * (step/w->period - floor(step/w->period + 0.5)); | 188 | double v = 2.0 * (step/w->period - floor(step/w->period + 0.5)); |
189 | double exe = w->min_wcet_ms + w->amplitude * abs(v); | 189 | double exe = w->min_wcet_ms + w->amplitude * fabs(v); |
190 | return(exe); | 190 | return(exe); |
191 | } | 191 | } |
192 | 192 | ||