By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,480 Members | 771 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,480 IT Pros & Developers. It's quick & easy.

Is it posible to use only stdio.h library to find roundup value, and find all the

P: n/a
Is it posible to use only stdio.h library to find roundup value, and find all the factor of a number


I am wondering how roundup is work with using a function but not cmath library, and how to find all the factor of a number by onlt stdio.h too.
Oct 22 '10 #1
Share this Question
Share on Google+
2 Replies


P: 10
I think you are asking if stdio.h header file has any mathematical functions.Check the link bellow..

http://www.cplusplus.com/reference/clibrary/cstdio/
Oct 23 '10 #2

Expert 100+
P: 2,398
Are you asking about rounding a floating point value? There are several rounding strategies:
  • Round towards zero (truncation). For example, 35.8 rounds to 35, -40.7 rounds to -40.
  • Round to nearest. For example, 35.3 rounds to 35, 35.6 rounds to 36. Not clear what 35.5 rounds to.
  • Round towards infinity. For example, 35.2 rounds to 36, -40.9 rounds to -40.
  • Round towards negative infinity. For example, 35.8 rounds to 35, -40.1 rounds to -41.
  • Round to larger magnitude. For example, 35.2 rounds to 36, -40.2 rounds to -41.
  • Some other strategy I haven't listed.
Which of these best suits your needs?

Notice that the C Standard assures you that "round towards zero" (truncation) is used automatically if you cast a floating point value into an integral variable.
Oct 23 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.