C or C++ : Incorrect usage of floating point type