Skip to main content

net_torque

Function net_torque 

Source
pub fn net_torque(torques: &[f64]) -> Option<f64>
Expand description

Computes the sum of a slice of torque values.

Returns Some(0.0) for an empty slice, None when any input is not finite, or None when the computed result is not finite.

ยงExamples

use use_torque::net_torque;

assert_eq!(net_torque(&[10.0, -4.0, 2.0]), Some(8.0));