Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Simple power-up question

Simple power-up question

Scheduled Pinned Locked Moved C#
question
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Star09
    wrote on last edited by
    #1

    It says I can't power up a double and a double

    double a = 1.8;
    double b = 2.9;

    a = a ^ b ;

    any ideas?

    C M D 3 Replies Last reply
    0
    • S Star09

      It says I can't power up a double and a double

      double a = 1.8;
      double b = 2.9;

      a = a ^ b ;

      any ideas?

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      b cannot be a double, that is correct.

      Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )

      1 Reply Last reply
      0
      • S Star09

        It says I can't power up a double and a double

        double a = 1.8;
        double b = 2.9;

        a = a ^ b ;

        any ideas?

        M Offline
        M Offline
        Member 1033907
        wrote on last edited by
        #3

        Use Math.Pow() instead. H.

        S 1 Reply Last reply
        0
        • S Star09

          It says I can't power up a double and a double

          double a = 1.8;
          double b = 2.9;

          a = a ^ b ;

          any ideas?

          D Offline
          D Offline
          Dan Neely
          wrote on last edited by
          #4

          <code>^</code> is the logical <a href="http://msdn.microsoft.com/en-us/library/zkacc7k1(VS.80).aspx">XOR</a>[<a href="http://msdn.microsoft.com/en-us/library/zkacc7k1(VS.80).aspx" target="_blank" title="New Window">^</a>] operator.   As was mentioned upthread you need to use <code>Math.Pow</code>.

          It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains. -- Pride and Prejudice and Zombies

          M 1 Reply Last reply
          0
          • M Member 1033907

            Use Math.Pow() instead. H.

            S Offline
            S Offline
            Star09
            wrote on last edited by
            #5

            Thanks, it worked!

            1 Reply Last reply
            0
            • D Dan Neely

              <code>^</code> is the logical <a href="http://msdn.microsoft.com/en-us/library/zkacc7k1(VS.80).aspx">XOR</a>[<a href="http://msdn.microsoft.com/en-us/library/zkacc7k1(VS.80).aspx" target="_blank" title="New Window">^</a>] operator.   As was mentioned upthread you need to use <code>Math.Pow</code>.

              It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains. -- Pride and Prejudice and Zombies

              M Offline
              M Offline
              Mycroft Holmes
              wrote on last edited by
              #6

              Did you ever screw that one up ;P

              Never underestimate the power of human stupidity RAH

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups