Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
C++
c++ how to make a negative float positive
Nguyen Quang
Programming language:
C++
2021-04-19 09:18:55
0
Q:
c++ how to make a negative float positive
Ken Graham
Code:
C++
2021-04-03 21:24:00
float f{-0.27452}; std::cout << fabs(f) << std::endl; // 0.27452
2
Tags
make
how
Related
round double to n decimal places c++
round double to 2 decimal places c++
how to type cast quotient of two integers to double with c++
c++ scanf always expects double and not float
set precision with fixed c++
how to change a string to an float in c++
double to float c++
c++ float array zero
float in c++
c++ modulo make it give only positive numbers
New to Communities?
Join the community