Library reference

Exponential growth

Use the natural exponential when a model describes continuous growth or decay. A rate of zero leaves the starting amount unchanged.

f64::exp

Simple example

Evaluate the exponential at zero.

Start0
Result1
main.rs
fn main() {
    println!("{}", (0.0_f64).exp());
}
Output
1
Advertisements

Everyday examples

An animation starts with ten dots. Its growth setting is zero. How many dots does the model show?

Start0
Result10
main.rs
fn main() {
    println!("{}", 10.0 * (0.0_f64).exp());
}
Output
10

A sound effect starts at level eight. After one decay interval its level is eight times the exponential of minus one. What level remains?

Start-1
Result2.9430355293715387
main.rs
fn main() {
    println!("{}", 8.0 * (-1.0_f64).exp());
}
Output
2.9430355293715387

A classroom growth model starts at five units. After one growth interval what amount does the model predict?

Start1
Result13.591409142295225
main.rs
fn main() {
    println!("{}", 5.0 * (1.0_f64).exp());
}
Output
13.591409142295225
Run the example
Terminal
rustc main.rs
./main
Official documentation