You need to use cast. I see the other answers, and they will really work, but as the tag is C++ I’d suggest you to use static_cast:
float m = static_cast< float >( a.y - b.y ) / static_cast< float >( a.x - b.x );
You need to use cast. I see the other answers, and they will really work, but as the tag is C++ I’d suggest you to use static_cast:
float m = static_cast< float >( a.y - b.y ) / static_cast< float >( a.x - b.x );