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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:42:51+00:00 2026-06-14T02:42:51+00:00

I am making a calculator, for operations such as addition I used code as

  • 0

I am making a calculator, for operations such as addition I used code as

if ([operand isEqualToString:@"+"])
        lastKnownValue += currentValue; 

Which means that if the plus button is tapped, to the number the user specified before that, the number specified after is added.
Pretty much same works with division, by using

/=

And so on.

But how can I make it calculate the first number to the power of the second?
Or calculate the root (with the base of the second number) of the first number?

  • 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-14T02:42:52+00:00Added an answer on June 14, 2026 at 2:42 am

    You can compute a power using the pow function:

    lastKnownValue = pow(lastKnownValue, currentValue);
    

    The y’th root of x is the same as x to the 1/y power:

    lastKnownValue = pow(lastKnownValue, 1.0/currentValue);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is code from an addition calculator that does operations by entering the two
Making an adobe flex ui in which data that is calculated must use proprietary
I'm making a calculator-type application and it will have a resulting string that is
I am making an all-in-one calculator (I guess). Here is my code (I know
Currently I am making a Calculator that allows the user to type out the
I'm making a console calculator, and I want to remove any whitespace that the
I'm working on an assignment which involves making an RPN calculator. I am currently
I am making a graphical calculator program in Java and have a method that
I am making a calculator which will work as follows: the user will put
I am a beginner in C# , and making a calculator . But i

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.