floating point - Simple int to float conversion in c++ -


my function called "inverzmatrika" returns int type of variable. need convert floating-point number. suggestions?

float inverz; inverz = (float)(inverzmatrika(matrika)); 

use static_cast, don't use c style cast

float inverz = static_cast<float>(inverzmatrika(matrika)); 

Comments

Popular posts from this blog

c++11 - Intel compiler and "cannot have an in-class initializer" when using constexpr -

rest - Spring boot: Request method 'PUT' not supported -

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -