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

  • SEARCH
  • Home
  • 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 7802549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:17:56+00:00 2026-06-02T01:17:56+00:00

I just found a strange problem in the programming language ruby, it isn’t a

  • 0

I just found a strange problem in the programming language ruby, it isn’t a big problem, but I just can’t understand why it happens. It would interest me if someone knows the problem for my problem.

In ruby you can write 0 or 00, that doesn’t matter, it comes to the same result.
If you run 0 === 00 you also get true meaning that the two inputs are exactly the same.

0.0 also equals 0, so logically 00.0 should also equal 0.0 but the problem is,
that if you try to use the number 00.0 then you’ll just get an error. If you run for example:

a = 00.0

You get this error:

syntax error, unexpected tINTEGER

Of course I know this is a small problem, but as said I’d like to understand why the computer doesn’t treat 00.0 the same as 0.0?

  • 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-02T01:17:57+00:00Added an answer on June 2, 2026 at 1:17 am

    The thing is that when parsing and ruby sees that a number with more than two digits starts with the character 0, it parses it as an octal integer number. Thus, when it parses 00, it is 0 in octal which is the same as 0 in decimal. But if it finds a . then it is an invalid integer and that is the error it shows.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Edited: SOLUTION FOUND. This is strange and not the best solution, but I just
We just found something strange with our rails 3.1.3 app's application.js. The problem is
I just found some strange behavior of database's order by clause. In string comparison,
Possible Duplicate: Empty for loop - for(;;) I just found a strange construct in
I just got a strange problem. I am including some files from my index.php,
I've got a very strange problem and tried several solutions found in the www,
I've encountered with some strange problem. It's strange for me because I don't understand
I just come across a strange problem where i cannot retrieve the sql stored
I just encountered this strange situation: I found an example, where wx.Frame's OnPaint is
I found a strange problem when I used class Generics Today: Setting some broke

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.