title: How to somehow define enum type as float or double in c#
body: <p>It says <a href="http://msdn.microsoft.com/en-us/library/sbbt4032.aspx" rel="noreferrer">here</a> that the possible types for an <code>enum</code> are <code>byte</code>, <code>sbyte</code>, <code>short</code>, <code>ushort</code>, <code>int</code>, <code>uint</code>, <code>long</code>, or <code>ulong</code>.</p>
  
  <p>What if I need a <code>float</code> or a <code>double</code> to define percentage increments such as <code>1.5</code> or <code>2.5</code> for example? Am I stuck?</p>
  
  <p>As said here:
  <a href="http://en.csharp-online.net/.NET_Type_Design_Guidelines%E2%80%94Enum_Design" rel="noreferrer">http://en.csharp-online.net/.NET_Type_Design_Guidelines%E2%80%94Enum_Design</a></p>
  
  <blockquote>
    <p>An enum is a structure with a set of static constants. The reason to
    follow this guideline is because you will get some additional compiler
    and reflection support if you define an enum versus manually defining
    a structure with static constants.</p>
  </blockquote>
  
  <p>Since an enum is a set of constants, why can't I have float constants ? </p>
  
  <p>Update: it is said here:
  <a href="http://en.csharp-online.net/.NET_Type_Design_Guidelines%E2%80%94Enum_Design" rel="noreferrer">http://en.csharp-online.net/.NET_Type_Design_Guidelines%E2%80%94Enum_Design</a>
  "Did you know that the CLR supports enums with an underlying type of float or double even though most languages don't choose to expose it?" </p>
  
  <p>Since I'm only using c# is there a way to do so with some hacks ?</p>