fix doc matrix to vector for regress_simple
[liba.git] / tests / a.rs
blob0b687346267abe828ae152a91adc062d05637d27
1 #[test]
2 fn usqrt() {
3     std::println!("{}", liba::u32_sqrt(u32::MAX));
4     std::println!("{}", liba::u64_sqrt(u64::MAX));
7 #[test]
8 fn rsqrt() {
9     std::println!("1/sqrt({})={}", 4, liba::f32_rsqrt(4.0));
10     std::println!("1/sqrt({})={}", 4, liba::f64_rsqrt(4.0));
13 #[test]
14 fn hash() {
15     let text: [u8; 10] = *b"0123456789";
16     std::println!("{}", liba::hash_bkdr(&text, 0));
17     std::println!("{}", liba::hash_sdbm(&text, 0));
20 #[test]
21 fn roll() {
22     let mut x = [1.0, 2.0, -3.0];
23     std::println!("{:?}", x);
24     liba::float_push(&mut x, 0.0);
25     std::println!("{:?}", x);
26     liba::float_roll(&mut x);
27     std::println!("{:?}", x);
30 #[test]
31 fn sum() {
32     let x = [1.0, 2.0, -3.0];
33     std::println!(
34         "sum({:?})={},{},{}",
35         x,
36         liba::float_sum(&x),
37         liba::float_sum1(&x),
38         liba::float_sum2(&x)
39     );