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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:43:47+00:00 2026-05-30T18:43:47+00:00

So Int32 does not have an == operator but this is valid code bool

  • 0

So Int32 does not have an == operator but this is valid code

bool y = 6 == 5;

This is because Int32 is part of the primitive set of types. It effectively compiles to CEQ in IL.

So given a Type (with reflection) how can it be determined that that type supports CEQ when it has no == 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-30T18:43:49+00:00Added an answer on May 30, 2026 at 6:43 pm

    The spec says (§7.10):

    The predefined integer comparison operators are:

    bool operator ==(int x, int y);
    bool operator ==(uint x, uint y);
    bool operator ==(long x, long y);
    bool operator ==(ulong x, ulong y);
    

    The predefined floating-point comparison operators are:

    bool operator ==(float x, float y);
    bool operator ==(double x, double y);
    

    The predefined decimal comparison operators are:

    bool operator ==(decimal x, decimal y);
    bool operator !=(decimal x, decimal y);
    

    The predefined boolean equality operators are:

    bool operator ==(bool x, bool y);
    bool operator !=(bool x, bool y);
    

    Every enumeration type implicitly provides the following predefined
    comparison operators:

    bool operator ==(E x, E y);
    bool operator !=(E x, E y);
    

    Note that decimal.operator == is a normal method, not a built-in operator. I’m not sure why it’s listed there.

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

Sidebar

Related Questions

HI, I have code below but getting error object does not match target type
x86 does not have an SSE instruction to convert from unsigned int32 to floating
I think that this is not possible because Int32 has 1 bit sign and
The code below gives an error: Property 'Int32 Key' is not defined for type
I have this C-code to do multiplications over GF(8): int32_t GaloisMultiply (int32_t a, int32_t
I knew nHibernate does not support UNION. But there are some tricks, we can
So I have an object called FixedSizeList that does not have a parameterless constructor.
I have a single view in my application which does not receive any events
I am not sure this is even possible, but I am hoping for a
typeof(int).Name Will return System.Int32 does anyone know of a way to return int

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.