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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:57:28+00:00 2026-06-14T14:57:28+00:00

Why is decimal not a primitive type? Console.WriteLine(typeof(decimal).IsPrimitive); outputs false . It is a

  • 0

Why is decimal not a primitive type?

Console.WriteLine(typeof(decimal).IsPrimitive);

outputs false.

It is a base type, it’s part of the specifications of the language, but not a primitive. What primitive type(s) do represent a decimal in the framework? An int for example has a field m_value of type int. A double has a field m_value of type double. It’s not the case for decimal. It seems to be represented by a bunch of ints but I’m not sure.

Why does it look like a primitive type, behaves like a primitive type (except in a couple of cases) but is not a primitive type?

  • 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-14T14:57:29+00:00Added an answer on June 14, 2026 at 2:57 pm

    Although not a direct answer, the documentation for IsPrimitive lists what the primitive types are:

    http://msdn.microsoft.com/en-us/library/system.type.isprimitive.aspx

    A similar question was asked here:

    http://bytes.com/topic/c-sharp/answers/233001-typeof-decimal-isprimitive-false-bug-feature

    Answer quoted from Jon Skeet:

    The CLR doesn’t need to have any intrinsic knowledge about the decimal
    type – it treats it just as another value type which happens to have
    overloaded operators. There are no IL instructions to operate directly
    on decimals, for instance.

    To me, it seems as though decimal is a type that must exist for a language/runtime wanting to be CLS/CLI-compliant (and is hence termed “primitive” because it is a base type with keyword support), but the actual implementation does not require it to be truly “primitive” (as in the CLR doesn’t think it is a primitive data type).

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

Sidebar

Related Questions

int price=' '; // attempt to grab a decimal number - but not the
Why modulo runs fine with decimal but not with float/real MSDN states about it
Title pretty much says everything. would like to print (NOT in decimal), but in
Why does this: (new[]{1,2,3}).Cast<decimal>(); result in an InvalidCastException: Specified cast is not valid.
I'm using decimal type (.net), and I want to see if two numbers are
I am using c# decimal for high accuracy project but was stuck at the
I want to be able to output in decimal and not scientific for all
There is a table: CREATE TABLE temp ( IDR decimal(9) NOT NULL, IDS decimal(9)
I want to convert nullable decimal to primitive decimal. How to do this. I
Whenever I say decimal, I mean system.decimal not the mathematical concept decimal min =

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.