use dynamic casts in tests to ensure type correctness as test runtime
add Float
remove unneeded local var