pow(x,n)
来源:互联网 发布:medea软件 编辑:程序博客网 时间:2024/06/01 07:22
Implement pow(x, n).
public class Solution { public double myPow(double x, int n) { if(n == 0){ return 1; } if(n < 0){ n = -n; x= 1/x; } return (n%2 ==0 ? myPow(x*x,n/2),x*myPow(x*x,n/2)); }}
http://blog.csdn.net/fengbingyang/article/details/12236121
0 0
- Pow(x, n) / Super Pow
- LeetCode: Pow(x, n)
- LeetCode Pow(x,n)
- [Leetcode] Pow(x, n)
- LeetCode: Pow(x, n)
- Leetcode: Pow(x,n)
- [LeetCode] Pow(x, n)
- [Leetcode] Pow(x,n)
- Pow(x, n)
- 【leetcode】Pow(x, n)
- Pow(x, n)
- 求 pow(x, n)
- [LeetCode]Pow(x, n)
- Pow(x,n)
- Pow(x, n)
- Pow(x, n)
- [leetcode]Pow(x, n)
- LeetCode-Pow(x, n)
- 转载点关于lunix的命令
- zzuli OJ 1000: 整数a+b
- HDU 1301 Jungle Roads
- [bzoj3107][CQOI2013]二进制a+b
- 常用数据库对比
- pow(x,n)
- MyBatis教程之分页和动态SQL语句基础
- 面试进行曲之技术面试(项目经验)
- Struts(11)文件上传
- IIS 服务器的配置
- 获取键盘高度
- Eclipse使用入门教程
- 《JSF教程》-02 JSF与Struts2、Springmvc的对比
- Struts(10)值栈/OGNL