variable equal one but don't equal one

Welcome to floating point!

As I have quoted before from Kernigham and Plauger Elements of Programming Style, "Floating point numbers are like sandpiles. Everytime you move one you lose a little sand and pick up a little dirt."

Also in your case, you are not comparing a floating point number to a floating point number, you are comparing a floating point number with the integer 1. You should use:
cursf == 1.0

Though it probably won't make a difference in this case, since the compiler will probably make the exact same code either way.