Check out example codes for "c++ how to make a negative float positive". It will help you in understanding the concepts better.

Code Example 1

float f{-0.27452};
std::cout << fabs(f) << std::endl; // 0.27452

Learn ReactJs, React Native from akashmittal.com