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 9016039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:53:43+00:00 2026-06-16T03:53:43+00:00

Using insert , I push values to an Array as: myarray=[22,33,44] myarray.insert(0,02) # =>

  • 0

Using insert, I push values to an Array as:

myarray=[22,33,44]
myarray.insert(0,02)
# => [2,22,33,44]

If do the following, I get:

myarray.insert(0,020)
# => [16,2,22,33,44]

020 becomes 16? If I do the following, I get:

myarray.insert(0,0200)
# => [128,16,2,22,33,44]

0200 becomes 128? May I know the reason for this?

  • 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-16T03:53:44+00:00Added an answer on June 16, 2026 at 3:53 am

    If the number has a zero in front of it, ruby treats it as an octal number (base 8)

    You can do similar with binary/hexadecimal too

    0x20 => 32 (hexadecimal)
    020 => 16 (octal)
    0b10 => 2 (binary)
    080 => Invalid octal digit
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to get the story_id from the last insert. Ive tried using mysql_insert_id()
Using the following code, I've not been able to push any recurring events to
I want to insert a shared vector into a shared map using the following
I'm using INSERT INTO to copy rows of data from one table to another:
I am using simple insert statement to insert value to CLOB varaible, anyway i
I am importing csv to db using bulk insert. It is the comma delimited
So I'm trying to do a simple insert using Linq but i'm running into
I am using mysql_query(INSERT INTO imaegs_backup SELECT * FROM images); in order to copy
I'm using PDO to insert a record (mysql and php) $stmt->bindParam(':field1', $field1, PDO::PARAM_STR); $stmt->bindParam(':field2',
I am using Hibernate to insert a row into a database, I am using

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.