Are you allowed to rewrite the file? Cause if reading it that way is a problem, then you should store floating point numbers in the file as well. Then you can just read them into memory at once.

If not, then what MacGyver suggested is as good as it's going to get it seems.