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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jackson Werid

    #1

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

    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.
  • Gauarv Kumar
    New Member
    • Oct 2010
    • 10

    #2
    I think you are asking if stdio.h header file has any mathematical functions.Check the link bellow..

    Comment

    • donbock
      Recognized Expert Top Contributor
      • Mar 2008
      • 2427

      #3
      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.

      Comment

      Working...