Results 1 to 2 of 2

Thread: power

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2008
    Posts
    1

    power

    how do i 2 to the power of any exponent WITHOUT using the Math.pow method?

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: power

    A for loop, a recursive method, or a bit shifting operation can do it. Depends on what your instructor is expecting.

    unsigned left shift would be the best way to go just FYI
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width