Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8763113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:42:16+00:00 2026-06-13T15:42:16+00:00

Running ruby 1.8.7. (1.005 * 100).round result: 100 (1.006 * 100).round result: 101 100.5.round

  • 0

Running ruby 1.8.7.

(1.005 * 100).round
result: 100

(1.006 * 100).round
result: 101

100.5.round
result: 101

(1.005 * 100)
result: 100.5

What is going on here? Can someone try this in the latest version of ruby please?
Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T15:42:17+00:00Added an answer on June 13, 2026 at 3:42 pm

    Floating Point Math is what’s going on.

    For the last one, I do not get 100.5, and you aren’t either, even if for some reason it’s displaying as that:

    Loading development environment (Rails 3.2.8)
    1.9.3p194 :001 > (1.005 * 100).round
     => 100 
    1.9.3p194 :002 > (1.006 * 100).round
     => 101 
    1.9.3p194 :003 > 100.5.round
     => 101 
    1.9.3p194 :004 > (1.005 * 100)
     => 100.49999999999999 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Running ruby 1.9.2p290 and the latest version of Sinatra. When I try to run
say a ruby script is running ruby.rb SOMEUSERID using PHP, how can i find
I'm new to Rack and try to get my head around it running Ruby
I've tried this on a few machines on different networks, all running ruby 1.8.7
Can I drop to an IRB prompt from a running Ruby script? I want
I'm running Ruby 1.9.2p290 and Rails 3.1.0.rc5. When I run this regex it matches
I am running Ruby 1.9. This is a valid syntax: items = (data['DELETE'] ||
I'm running Ruby installed from RubyInstaller . Here's the version: C:\Users\Sathya>ruby -v ruby 1.9.2p290
Running RUby 1.9.3-p194 and Rails 3.2.3 and the latest paperclip gem. I am following
I'm running Ruby ruby 1.9.3p125 and I keep getting this error which is making

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.