Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have been getting this issue and as a beginner I cant understand it #1746

Open
bhyy-space opened this issue Apr 17, 2024 · 1 comment
Open

Comments

@bhyy-space
Copy link

Runtime error in leetcode is

AddressSanitizer:DEADLYSIGNAL

==24==ERROR: AddressSanitizer: stack-overflow on address 0x7ffedda61ff8 (pc 0x560e2f1ae618 bp 0x7ffedda62010 sp 0x7ffedda62000 T0)
==24==ABORTING

In code for exponent--

double myPow(double x, int n) {
if(n==0){
return 1;
}
else if(n>0){
return x*myPow(x,n-1);
}

else{
    int p = -n;
    double re = myPow(x,p);
    return  1/re;
}

}

@gopalrander
Copy link

when do you see this error? What are the values of x and n for which you see this error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants