compact way of casting double to float, still looping though