Answers for "hoe to know float number in c++"

C++
3

check if float has decimals c++

if (some_float == (int)some_float) {
	// decimal part == 0.0 i.e. no fractional part
}
Posted by: Guest on September-14-2020
0

Setting a number of decimals on a float on C++

cout.setf(ios::fixed);
cout.precision(2);
Posted by: Guest on July-17-2021

Browse Popular Code Answers by Language