MCPcopy Create free account
hub / github.com/cosdata/cosdata / x_function

Function x_function

org/src/main.rs:35–55  ·  view source on GitHub ↗

x_function remains the same

(value: u32)

Source from the content-addressed store, hash-verified

33
34// x_function remains the same
35pub fn x_function(value: u32) -> u32 {
36 match value {
37 0 => 0,
38 1 => 1,
39 2 => 1,
40 3 => 2,
41 4 => 1,
42 5 => 2,
43 6 => 2,
44 7 => 3,
45 8 => 1,
46 9 => 2,
47 10 => 2,
48 11 => 3,
49 12 => 2,
50 13 => 3,
51 14 => 3,
52 15 => 4,
53 _ => 0, // Invalid input
54 }
55}
56
57pub fn shift_and_accumulate(value: u32) -> u32 {
58 let high = (value >> 16) as u16;

Callers 1

shift_and_accumulate_u16Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected