python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Why does C++ automatically rounds float
I have a code like this...
#include<iostream>
using namespace std;
int main(){
float num;
cin >> num;
cout << num;
return 0;
}
Input: 256.1024
Output: 256.102
Why does...

Antonio2502
Votes: 0
Answers: 0
C# to C++: Convert C# Time calculation to C++ chrono
I've got the task to convert some C# code to C++ and I've problems with chrono. Goal is to round a time to a variable time span.
C#:
int iRoundTo = 30; // can be 45 or other variable value, not a cons...
Mighty
Votes: 0
Answers: 2
Python rounding final answer from a formula
Currently have a formula that outputs a number, with the round() function rounding the answer to a whole number. How can I get 3 decimal places in my answers.
Odd request, but is there a way for it to...
user17442276
Votes: 0
Answers: 2
How to round to an arbitrary (non power-of-ten) precision
Let’s imagine I would like to round a number (i.e x = 7.4355) to a given arbitrary precision (i.e p = 0.002). In this case, I would expect to see:
round_arbitrary(x, p) = 7.436
What would be the best...

Magix
Votes: 0
Answers: 1