Generic Moving Average calculation for the integer types
and float types
Add this to your Cargo.toml:
toml
[dependencies]
movavg = "2"
``` rust
// Integers
let mut avg: MovAvg
// Floats
let mut avg: MovAvg
// Bigger accumulator
let mut avg: MovAvg
If you want to use movavg without the [std]{.title-ref} library (often called [no_std]{.title-ref}), then use the following Cargo.toml dependency to disable the [std]{.title-ref} feature:
toml
[dependencies]
movavg = { version = "2", default-features = false }
Currently the [no_std]{.title-ref} variant supports all functionality that the default [std]{.title-ref} variant supports. But that may change in future.
The [fastfloat]{.title-ref} feature can be used to enable much faster, but less accurate floating point calculations. Enabling this feature leads to bigger floating point rounding and cancellation errors.
toml
[dependencies]
movavg = { version = "2", features = ["fastfloat"] }
This feature may also be used together with disabled [std]{.title-ref} feature (see [no_std]{.title-ref}).
Requires Rust compiler version 1.61 or later.
Copyright (c) 2021-2023 Michael Büsch \<m@bues.ch>
Licensed under the Apache License version 2.0 or the MIT license, at your option.