⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bigintegers.java

📁 非常接近C/S操作方式的Java Ajax框架-ZK 用ZK框架使你的B/S应用程序更漂亮更易操作。 官网:www.zkoss.org
💻 JAVA
字号:
/* BigIntegers.java{{IS_NOTE	Purpose:			Description:			History:		Fri Sep 19 13:06:48     2003, Created by tomyeh}}IS_NOTECopyright (C) 2003 Potix Corporation. All Rights Reserved.{{IS_RIGHT	This program is distributed under GPL Version 2.0 in the hope that	it will be useful, but WITHOUT ANY WARRANTY.}}IS_RIGHT*/package org.zkoss.math;import java.math.BigInteger;import org.zkoss.lang.Objects;/** * BigInteger utilities. * * @author tomyeh */public class BigIntegers {	/** Represents 0 in big integer.	 */	public static final BigInteger ZERO = BigInteger.ZERO;	/** Converts an integer to a big integer.	 */	public static final BigInteger toBigInteger(int v) {		return v == 0 ? ZERO: new BigInteger(Objects.toByteArray(v));	}	/** Converts a long to a big integer.	 */	public static final BigInteger toBigInteger(long v) {		return v == 0 ? ZERO: new BigInteger(Objects.toByteArray(v));	}	/** Converts a short to a big integer.	 */	public static final BigInteger toBigInteger(short v) {		return v == 0 ? ZERO: new BigInteger(Objects.toByteArray(v));	}	/** Converts a byte to a big integer.	 */	public static final BigInteger toBigInteger(byte v) {		return v == 0 ? ZERO: new BigInteger(Objects.toByteArray(v));	}	/** Converts an integer to a big integer.	 */	public static final BigInteger toBigInteger(Integer v) {		return toBigInteger(v.intValue());	}	/** Converts a long to a big integer.	 */	public static final BigInteger toBigInteger(Long v) {		return toBigInteger(v.longValue());	}	/** Converts a short to a big integer.	 */	public static final BigInteger toBigInteger(Short v) {		return toBigInteger(v.shortValue());	}	/** Converts a byte to a big integer.	 */	public static final BigInteger toBigInteger(Byte v) {		return toBigInteger(v.byteValue());	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -