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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:19:12+00:00 2026-05-30T05:19:12+00:00

How can I translate the following code to objective c? (Value is an int)

  • 0

How can I translate the following code to objective c? (Value is an int)

while (value != 0) {
    value >>>= 1;

And is there a general replacement for the >>> operator?

  • 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-05-30T05:19:13+00:00Added an answer on May 30, 2026 at 5:19 am

    The operation is not directly supported, so you need to use a mask. Depending on the size of your value variable, you need to pick a mask of a different size.
    If value is short, use 0x7FFF; if value is long long, use 0x7FFFFFFFFFFFFF.

    while (value != 0) {
        value >>= 1;
        value &= 0x7FFFFFFF;
    }
    

    Alternatively, you can declare value as unsigned: then the regular shift-assign would not sign-extend the value. In fact, big part of the reason the >>> operator was added to Java is the absence of unsigned types in the language.

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

Sidebar

Related Questions

Can any body translate the following c# code to vb. I have tried telarik
Can anybody translate the following code to C++? Is this possible at all or
Can someone translate me the following code from VB to C#? As far as
How can I translate the following Ruby code to Bash? if ARGV.length == 0
I have a C++ API prototype void Func(int& size); How can I translate it
I'm using the following code to verify the application is signed. It's in Objective-C
I have to translate the following code from Java to Scala: EDIT: added if-statements
How to translate properly the following Java code to C++? Vector v; v =
I would like to know how to translate the following code to codebehind instead
Hey folks, I have the following piece of code from C++. for (int i=0;

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.