Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

computing roots on a calculator

Status
Not open for further replies.

Zak28

Advanced Member level 2
Joined
Aug 19, 2016
Messages
579
Helped
6
Reputation
12
Reaction score
6
Trophy points
18
Activity points
4,681
currently calculators accept square roots as sqrt(9) which is 3

but how to change the root so as to compute a cube root or more than 3rd roots?
 

BradtheRad

Super Moderator
Staff member
Joined
Apr 1, 2011
Messages
14,227
Helped
2,814
Reputation
5,636
Reaction score
2,754
Trophy points
1,393
Location
Minneapolis, Minnesota, USA
Activity points
106,135
A basic method to take cube root of 9:
* take log(9)
* divide by 3
* take antilog

A scientific calculator has a button to calculate X to the Y power. The cube root of 9= (9)^1/3 power.

Or a button to calculate #Xth root of Y.
 
  • Like
Reactions: Zak28

    Zak28

    Points: 2
    Helpful Answer Positive Rating

Zak28

Advanced Member level 2
Joined
Aug 19, 2016
Messages
579
Helped
6
Reputation
12
Reaction score
6
Trophy points
18
Activity points
4,681
A basic method to take cube root of 9:
* take log(9)
* divide by 3
* take antilog

A scientific calculator has a button to calculate X to the Y power. The cube root of 9= (9)^1/3 power.

Or a button to calculate #Xth root of Y.

I meant on calculators such as bc or the google chrome searchbar calculator.
 

c_mitra

Advanced Member level 5
Joined
Nov 13, 2012
Messages
3,787
Helped
928
Reputation
1,858
Reaction score
917
Trophy points
1,393
Activity points
29,831
It cannot be done (in a single step) on a basic calculator; but the search bar calculator is quite powerful.

You can type either ** or a ^ as the power symbol (operation). In other words, x**y and x^y means the same: x raised to the power of y.

If the power is integer you simply type it as such. For roots (say cube roots) you need to type 1/3 in parenthesis: 27^(1/3) will give you 3.

Internally, the numeric processor uses an algorithm very similar to the one pointed out in post #2. If both x and y are floats, x^y is computationally very expensive in time (it does take lots of time or cpu cycles).
 
  • Like
Reactions: Zak28

    Zak28

    Points: 2
    Helpful Answer Positive Rating

Zak28

Advanced Member level 2
Joined
Aug 19, 2016
Messages
579
Helped
6
Reputation
12
Reaction score
6
Trophy points
18
Activity points
4,681
They should implement

crt(x) cube root
qrt(x) quad root

currently only sqrt(x) is implemented.
 

Akanimo

Advanced Member level 3
Joined
Aug 30, 2016
Messages
717
Helped
127
Reputation
254
Reaction score
127
Trophy points
43
Activity points
4,920
The nth root of a number x can be found by x^(1/n). If you have the x-power-time button, then you use it.

- - - Updated - - -

They should implement

crt(x) cube root
qrt(x) quad root

currently only sqrt(x) is implemented.

It has already been implemented. But it's dynamic, so you can select the power you wish yourself. That is what has been done with the x^y function.
 
  • Like
Reactions: Zak28

    Zak28

    Points: 2
    Helpful Answer Positive Rating

c_mitra

Advanced Member level 5
Joined
Nov 13, 2012
Messages
3,787
Helped
928
Reputation
1,858
Reaction score
917
Trophy points
1,393
Activity points
29,831
qrt(x) quad root

It is simple if you have the sqrt function: quad root is nothing but sqrt(sqrt(x)).

If you are familiar with Newton Raphson method, you can use that for many different problems.

The real problems are (float)^(float)- they are hard to manage numerically.
 
  • Like
Reactions: Zak28

    Zak28

    Points: 2
    Helpful Answer Positive Rating

Zak28

Advanced Member level 2
Joined
Aug 19, 2016
Messages
579
Helped
6
Reputation
12
Reaction score
6
Trophy points
18
Activity points
4,681
The nth root of a number x can be found by x^(1/n). If you have the x-power-time button, then you use it.

- - - Updated - - -



It has already been implemented. But it's dynamic, so you can select the power you wish yourself. That is what has been done with the x^y function.


Its not implemented I might file a bug with bc if they have a tracker.
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
49,118
Helped
14,378
Reputation
29,020
Reaction score
13,129
Trophy points
1,393
Location
Bochum, Germany
Activity points
283,151
As documented, bc ^ operator supports only integer power arguments. e(l(x)/3) however works. You can define it as a function if you like. Or use a somewhat more elaborated calculator.
 
  • Like
Reactions: Zak28

    Zak28

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top