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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:17:46+00:00 2026-06-17T13:17:46+00:00

OK, I was given a formula to determine a float value between 0.0 and

  • 0

OK, I was given a formula to determine a float value between 0.0 and 1.0 using i and j (coordinates of a value in a 2D array). I simply want to know exactly what this formula does. It makes no sense to me. I have implemented it in its own function where the int values of i and j are passed as parameters. Can someone provide an explanation? I don’t HAVE to understand it, as he gave it to us just to use as is, but I really want to know.

float col = float (((i & 0x08) == 0) ^ ((j & 0x08) == 0));

What exactly is going on here?

  • 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-17T13:17:47+00:00Added an answer on June 17, 2026 at 1:17 pm

    The result, if plotted with i,j as the x,y coordinates, will be a checkerboard with squares of 8×8 pixels.

    The i & 0x08 and j & 0x08 are just testing a single bit of each axis. That bit will change state every 8 pixels.

    The == 0 will convert each result to a boolean, which evaluates to either a 0 or 1. It also inverts the result, but I don’t think that’s relevant in the overall formula.

    The ^ exclusive-or operator will return 0 if the two are the same, or 1 if they’re different. That’s how you get the checkerboard – the result alternates each time either i or j crosses a boundary.

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

Sidebar

Related Questions

Given a 2x3 array, [1,2,3] [4,5,6] it is easy to store this linearly using
I know there is formula for going RGB -> Luminance, but I need given
Given a certain date, I want to set the value of a cell with
I want to find a combinatorial formula that given a certain number of integers,
The formula print method does not respect the environment width option. For example, given
I want to have a formula that calculates the sum of a given range.
Using Stata I want a formula (line of code) that takes all of the
Given this method to work on a HTML page in a webbrowser: bool semaphoreForDocCompletedEvent;
Given the following code: $(.force-selection).blur(function() { var value = $('matched-item').val(); //check if the input's
To a person skilled in programming, I know this question might seem ridiculous, but

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.