MCPcopy Index your code
hub / github.com/douchuan/algorithm / magnitude

Function magnitude

tests/test_sparse_vec.rs:13–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12#[test]
13fn magnitude() {
14 let (a, _) = create();
15 assert_relative_eq!(
16 a.magnitude(),
17 (0.5_f64.powf(2.0) + 0.75_f64.powf(2.0)).sqrt()
18 );
19}
20
21#[test]
22fn scale() {

Callers

nothing calls this directly

Calls 1

createFunction · 0.85

Tested by

no test coverage detected