title: Why am I receiving wrong values (resistor color code calculator)
body: <p>I want to make a resistor color code calculator but it seems it doesn't work properly. Most combinations seem to return accurate values but whenever I try using gold and silver multipliers, the code returns 0.00. Since gold is 10^-1; shouldn't the code return 22*10^-2 which is 0.22? How can I fix this issue?</p>
  <pre><code>typedef enum Color {
      SILVER = -2 ,
      GOLD = -1 ,
      BLACK = 0,
      BROWN,
      RED,
      ORANGE,
      YELLOW,
      GREEN,
      BLUE,
      VIOLET,
      GREY,
      WHITE
  } Color;
  
  
  
  typedef struct Resistor {
      Color ring1;
      Color ring2;
      Color multiplier;
  } Resistor ;
  
  double resistor_calculate_value(Resistor self) {
      return (self.ring1 * 10 + self.ring2) * (unsigned int) pow(10, self.multiplier);
  }
  
  int main() {
      Resistor res1;
      res1.ring1 = RED;
      res1.ring2 = RED;
      res1.multiplier = GOLD;
  
      printf(&quot;%f\n&quot;, resistor_calculate_value(res1));
  
      return 0;
  }
  </code></pre>