1. SPS Accounts:
    Do you find yourself coming back time after time? Do you appreciate the ongoing hard work to keep this community focused and successful in its mission? Please consider supporting us by upgrading to an SPS Account. Besides the warm and fuzzy feeling that comes from supporting a good cause, you'll also get a significant number of ever-expanding perks and benefits on the site and the forums. Click here to find out more.
    Dismiss Notice
Dismiss Notice
You are currently viewing Boards o' Magick as a guest, but you can register an account here. Registration is fast, easy and free. Once registered you will have access to search the forums, create and respond to threads, PM other members, upload screenshots and access many other features unavailable to guests.

BoM cultivates a friendly and welcoming atmosphere. We have been aiming for quality over quantity with our forums from their inception, and believe that this distinction is truly tangible and valued by our members. We'd love to have you join us today!

(If you have any problems with the registration process or your account login, please contact us. If you've forgotten your username or password, click here.)

How do you round up decimal numbers?

Discussion in 'Whatnots' started by Christopher_Lee, Feb 28, 2002.

  1. Christopher_Lee Gems: 10/31
    Latest gem: Zircon


    Joined:
    Jan 30, 2002
    Messages:
    371
    Likes Received:
    0
    Does anybody here happen to know how to round up decimal numbers that end in 5? For instance: 118.5.

    Please help!! :aaa::aaa:
     
  2. Asmodeus Gems: 5/31
    Latest gem: Andar


    Joined:
    Nov 19, 2001
    Messages:
    128
    Likes Received:
    0
    I thught it was common knowledge that decimals of 5 are supposed to be rounded upwards. 118.5 will make 119.
     
  3. Christopher_Lee Gems: 10/31
    Latest gem: Zircon


    Joined:
    Jan 30, 2002
    Messages:
    371
    Likes Received:
    0
    Is it? I always thought it was something to do whether the digit before it is even or odd-numbered? :confused::borg:
     
  4. the god Gems: 13/31
    Latest gem: Ziose


    Joined:
    Feb 5, 2002
    Messages:
    578
    Likes Received:
    0
    [​IMG] yep, rounding-up from 0.5 is what they teach in british schools anyway. :square:
     
  5. Jack Funk Gems: 24/31
    Latest gem: Water Opal


    Joined:
    Apr 24, 2001
    Messages:
    1,778
    Likes Received:
    25
    Same in USA.
     
  6. Mollusken Gems: 24/31
    Latest gem: Water Opal


    Joined:
    Aug 12, 2000
    Messages:
    1,952
    Likes Received:
    0
    C or C++ will tell you that it is 118.
     
  7. Spudsquisher Gems: 13/31
    Latest gem: Ziose


    Joined:
    May 16, 2001
    Messages:
    546
    Likes Received:
    0
    *puts on A-level economics hat*

    why do you wanna round it up?
    why not just leave the .5 and look clever?
    oh and we were always taught to go up.
    same as you work left to right when sloving things like: (3y + 2x) (13y - 5x)
     
  8. Jerlark386 Gems: 5/31
    Latest gem: Andar


    Joined:
    Nov 2, 2001
    Messages:
    103
    Likes Received:
    0
    rounding up is typical, but when it comes to money, rounding down is what you'll be doing more of.
     
  9. the god Gems: 13/31
    Latest gem: Ziose


    Joined:
    Feb 5, 2002
    Messages:
    578
    Likes Received:
    0
    [​IMG] :lol: J386 has hit the nail on the head.
     
  10. Avarahtar Gems: 7/31
    Latest gem: Tchazar


    Joined:
    Apr 5, 2001
    Messages:
    249
    Likes Received:
    0
    Actually by convention you are supposed to round to the nearest even number. So if the number is 118.5 you would round down to 118 but if it was 119.5 you would round up 120. This is to help eliminate the percentage error you would get if you always rounded the .5 up.
     
  11. Christopher_Lee Gems: 10/31
    Latest gem: Zircon


    Joined:
    Jan 30, 2002
    Messages:
    371
    Likes Received:
    0
    Yep that's it! I remember now that's the way I was taught to do it. Thank you Avarahtar! :cool:
     
  12. Maldir Gems: 11/31
    Latest gem: Bloodstone


    Joined:
    Jun 12, 2001
    Messages:
    433
    Likes Received:
    0
    There's no percentage error: x.00 to x.49 are rounded off to x.00, and x.50 to x.99 are rounded off to (x+1).00. Some computers convert decimals to integers by lopping off the numbers after the decimal point, which isn't the same as rounding off - it's rounding down.
     
  13. Spudsquisher Gems: 13/31
    Latest gem: Ziose


    Joined:
    May 16, 2001
    Messages:
    546
    Likes Received:
    0
    [​IMG] 118.541732
    118.54173
    118.5417
    118.542
    118.54
    118.5
    119
     
  14. Avarahtar Gems: 7/31
    Latest gem: Tchazar


    Joined:
    Apr 5, 2001
    Messages:
    249
    Likes Received:
    0
    When writting up experiments there is always a percentage error and if you always round the 5 up it can cause your result to be higher then it should be. This is especially true when working with a small amount of significant figures. I could type out an example of this but since it's not really a topic I care to spend much time arguing about I'm not going to waste my time with it.
     
Sorcerer's Place is a project run entirely by fans and for fans. Maintaining Sorcerer's Place and a stable environment for all our hosted sites requires a substantial amount of our time and funds on a regular basis, so please consider supporting us to keep the site up & running smoothly. Thank you!

Sorcerers.net is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to products on amazon.com, amazon.ca and amazon.co.uk. Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.