Changes in epsilon & binary cubic roots

Hi again,

I'm wondering if the epsilon variable is machine dependent, and what changes it (architecture/firmware/manufacturer), and how it would relate to the function of a cubic root search based on a binary search method:
1
2
3
4
5
6
7
8
9
10
        while (fabs(cu_rt * cu_rt * cu_rt- n) >= epsilon) {

                cu_rt = (low + high)/2.0;

                if (cu_rt * cu_rt * cu_rt> n) 
                        high = cu_rt;
                else
                        low = cu_rt;
                ++*num_guess;
        }


Thanks.

EDIT:
I found the issue. I was getting errors based on the fact that I have to use a pointer as an iterator, and I wasn't properly resetting it.
Last edited on
Topic archived. No new replies allowed.