added static test, fixed empty array problem with @test_approx_eq