+ 1
What can I do to increase the calculation accuracy in c ++? Can you give me an example?
By Using unit_32 for a variable input of datatype float
15 Answers
+ 3
Here's the very basic usage (read input and write to standard output stream).
#include <iostream>
#include <cstdint>
int main()
{
uint32_t my_var;
std::cin >> my_var;
std::cout << my_var << "\n";
return 0;
}
+ 4
Loads of maths XD
Not my cup of tea
Good luck anyways bro! 👍
+ 3
Ipang It was OK. Thank you for your response, Baby
+ 3
You're welcome!
But what about the float numbers? did you solve it?
+ 3
Ipang https://code.sololearn.com/cQ1s8a2rDBtf/?ref=app
Honestly, I asked the above question for the following program, but I have some difficulty in implementing its function.
(It calculate the angle between two geographical coordinates.
Take the pairs with a comma and return the angle between .)
+ 3
I don't understand what you meant by that.
+ 3
here you can do these things
intmain()
{
uint32_t my_var;
std::cin >> my_var;
std::cout << my_var << "\n";
return 0;
}
+ 2
Can you please be more descriptive here? not getting what is being cslculated, nor how uint32_t can help improve accuracy.
The better you describe the question, the better (more relevant) the incoming responses would be.
+ 2
Ipang We need to receive a few float number , and store them in memory.
You are right . I had better ask the question like this: How do I use the unit32_t injunction for variables to be necessarily 4 bytes? I hope it was clear.
+ 2
Faezeh Alinejad
I'm trying to understand ...
1. You are asked to read some floatng point values.
2. And you are asked to convert thr floating point values to 32bit unsigned integer (not sure about this one).
Did I get your description right? I'm not native English either TBH
+ 2
@lpang I just want an example of instruction unit32_t in cpp
Idont know how to use it?
See the link below
http://www.cplusplus.com/reference/cstdint/
+ 2
Is the use of doubles instead of floats an option?
+ 2
Sonic yas,is there the problem?
+ 1
Abhijeet I changed several compilers, but my compiler gives uint32_t an error.
I finally adjusted the accuracy with the setprecisin() command
0
Sonic When we define a variable double , we do not need to calculate it accurately with another command And in this question, the accuracy of the calculation was important to me.