Home > Back-end >  A custom function to realize the rounding
A custom function to realize the rounding

Time:10-10


For bosses to help see the realization of the second question is:
Why am I the while loop will always call my myround ()?
Always want to input data, realize the function of the data to test until the end of the input symbol
How to implement?

CodePudding user response:

Floating point Numbers not precise Numbers, use==or!=it is possible to get the desired results,
Try abs (a) & lt; 0.0001

CodePudding user response:

Well, you used a vs2010? Abs may want to convert into fabs

CodePudding user response:

I think a - (int) a & gt; 5 how is greater than 5? This judge is a fake?
Should not be greater than 0.5?
The main function of the scanf should be % f, not f

CodePudding user response:

reference 3 building self-confidence boy reply:
the building Lord think a - (int) a & gt; 5 how is greater than 5? This judge is a fake?
Should not be greater than 0.5?
The main function of the scanf should be % f, not f

So, thank you

CodePudding user response:

refer to the second floor fyn272064949 response:
well, you used a vs2010? Abs may want to convert into fabs

Thank you for your reply, is vs2010
I read a book on say with integrated tool to learn the c language programming, is it?

  • Related