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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:48:43+00:00 2026-06-12T13:48:43+00:00

I am creating random integers with the following algorithm: int random; int i; for

  • 0

I am creating random integers with the following algorithm:

int random;

int i;
for (i = 0; i < RANDOM_COUNT; i++) {
    random = (((int) rand() << 0) & 0x0000FFFFd)
            | (((int) rand() << 16) & 0xFFFF0000d);
    fprintf(outputFile, " %d\n", random);
}

I am getting the following warning:

warning: integer constant is too large for "long" type

on this line:

| (((int) rand() << 16) & 0xFFFF0000d);

I am using GCC 3.4.3 to compile the code.

Does anyone know which part of the operation is triggering the warning?

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

    Does anyone know which part of the operation [(((int) rand() << 16) & 0xFFFF0000d);] is triggering the warning?

    Yes, it’s the 0xFFFF0000d, because it’s 36 bits in size. Note that this number is equal to 0xFFFF0000D. You probably meant 0xFFFF0000.

    Likewise, 0x0000FFFFd is equal to 0x0000FFFFD. You probably meant 0x0000FFFF.

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

Sidebar

Related Questions

I have the following code: Class B { void generator() { // creating random
I'm creating a program that generates 100 random integers between 0 and 9 and
So I'm creating a random string value: var randomString = function(stringLength) { var i
I am creating a random ID using the below code: from random import *
I am creating a function that I would like to generate random strings from
using c# (asp.net) i'm programmatically creating several drop down lists (random number). the user
What I want to do is to generate a random number between and creating
Creating a class at runtime is done as follows: klass = Class.new superclass, &block
I am immensely troubled and disturbed by the fact that subversion is creating random
I'm creating some random classes to understand Polymorphism better. Coding is as follows: Poly1

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.