Guest User

Untitled

a guest
Oct 17th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. double power(double x,int n)
  2. {
  3. if (n == 0)
  4. return 1.0;
  5.  
  6. if(x == 0)
  7. {
  8. printf("Invalid Base: '0' ");
  9. return 1;
  10. }
  11. if(n < 0)
  12. {
  13. x = 1.0/x;
  14. n = -n;
  15. }
  16. demand(n>0, power failed);
  17. return power2(x, n);
  18. }
Add Comment
Please, Sign In to add comment