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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:04:45+00:00 2026-05-10T17:04:45+00:00

Today at work we came across the following code (some of you might recognize

  • 0

Today at work we came across the following code (some of you might recognize it):

#define GET_VAL( val, type ) \     {                                                   \         ASSERT( ( pIP + sizeof(type) ) <= pMethodEnd ); \         val = ( *((type *&)(pIP))++ );                  \     } 

Basically we have a byte array and a pointer. The macro returns a reference to a variable of type and advance the pointer to the end of that variable.

It reminded me of the several times that I needed to ‘think like a parser’ in order to understand C++ code.

Do you know of other code examples that caused you to stop and read it several times till you managed to grasp what it was suppose to do?

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-10T17:04:46+00:00Added an answer on May 10, 2026 at 5:04 pm

    The inverse square root implementation in Quake 3:

    float InvSqrt (float x){     float xhalf = 0.5f*x;     int i = *(int*)&x;     i = 0x5f3759df - (i>>1);     x = *(float*)&i;     x = x*(1.5f - xhalf*x*x);     return x; } 

    Update: How this works (thanks ryan_s)

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

Sidebar

Related Questions

Today, during some other somehow related work, came across my mind the following question:
I came across some javascript at work today that used jQuery to fetch two
Came across some code today that had a javascript array, made in php, using
I was playing around with some code today, and I came across the idea
I came across this piece of code today while tutoring some students in a
I was doing some work today, and came across an issue where something looked
I was doing some code review today and came across an old code written
I came across some code today where a string is compared to two values
Came into the office today to do some more work on my nearly completed
Today i'm cutting video at work (yea me!), and I came across a strange

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.