The last 3 digits are slightly off..
I'll run it one more time
x10 = 15.556349186104045536818575966307
Now they look the exact same.
I could run it more times but that's a pretty accurate number there..
So basically to make a sqrt function you must make a rough estimate to the sqrt ( it doesnt matter if you're wrong ) Technically you could use the same number as it...
@ chervil : didn't i define t in line 4,is anything else required?
@giblit : thanks man,i know what i am doing is not neat.i learnt these things but have no grab on the subject and was just trying to get my hands dirty..now that you have replied,i shall be taking your way :P
anyways,please tell me why i got that error.what's wrong and didn't i define the t type as int?
*edit: got it.so,i should have defined t in parentheses instead of globally.could anybody tell me why.thanks chervil for pointing it out. :)
*pps : @giblit : could you tell me which iteration method is that.[ n+1)th = 1/2(nth term + term/nth term)].i don't remember.thanks.
i should have defined t in parentheses instead of globally.could anybody tell me why
Because a function parameter is not the same thing as a global variable. Just because you define a function with a parameter that has the same name as a global variable, doesn't mean the compiler will magically give it the same type as the global variable.
When you define an entity, you need to explicitly declare its type.
thanks for your response.i thought as much.i guess what i want to know is how would defining t in those two ways be different or "why a function parameter can't be defined globally'.need to look up these things.thanks for the info guys. :)
@ giblit : i don't see what else i would need seeing you have provided all the info.thanks for this.let me try it out and i shall get back if i don't make it work.also,i actually wanted to know the name of the iteration method.(some specific name like secent method,bisection etc....is it one of them. :P)
@ mikeyboy : thanks man but i think i am not able put my question properly and anyways it's not important now.wrt your analogy i would say that i need the points which differentiates a cat from a dog(from genetics pov,the cat/dog question is not so bad,is it?) i.e. i just need more info to make sense of this internal functionality/syntax/convention of the language for which i need to do some reading. or maybe i am just overanalysing :p. anyhow,it's not important but thanks bearing with me.:)