How do you calculate common ratio in a geometric sequence or exponential function?

To calculate the common ratio in a geometric sequence or exponential function, you can use the formula:

r = a_{n+1} / a_n

where:
- r is the common ratio
- a_n is the nth term in the sequence
- a_{n+1} is the next term in the sequence after a_n

You can find the common ratio by dividing any term in the sequence by the previous term. This ratio will remain constant throughout the sequence if it is a geometric sequence or exponential function.