JAVA 大整数类
2016-05-19 20:44
344 查看
今天Java刚刚学习了大整数类,贴一篇非常简单的大整数类求阶乘的代码
package big;import java.math.BigInteger;public class factoria{public static void main(String[] args){// TODO Auto-generated method stubBigInteger p=BigInteger.ONE;BigInteger i=BigInteger.ONE;BigInteger n=new BigInteger("100");while(i.compareTo(n)<=0){p=p.multiply(i);System.out.println(i+"!="+p);i=i.add(BigInteger.ONE);}}}
相关文章推荐
- Java 集合小结
- java之stream(jdk8)
- 个人对Spring @Scope("prototype")的一些理解
- M进制与N进制之间的转换
- JAVA设计模式(18):行为型-状态模式(State)
- eclipse中java连接mysql数据库
- maven项目 启动报错:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- Spring
- 利用java实现二叉树以及非递归遍历算法
- JAVA设计模式(17):行为型-模板方法模式(Template Method)
- 【Java基础】语言基础知识
- 《JAVA:异常的处理》NumberFormatException异常
- access denied ("java.util.PropertyPermission" "*" "read,write")
- spring中乱码问题总结
- eclipse failed to create the java virtual machine
- java工程目录
- Java成长笔记-----垃圾回收机制
- Hibernate中的多对多关联
- Struts2中的redirect、redirectAction
- Spring IOC之容器实现过程