java.math.BigDecimal.movePoint()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(210)

本文整理了Java中java.math.BigDecimal.movePoint()方法的一些代码示例,展示了BigDecimal.movePoint()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BigDecimal.movePoint()方法的具体详情如下:
包路径:java.math.BigDecimal
类名称:BigDecimal
方法名:movePoint

BigDecimal.movePoint介绍

[英]Returns a new BigDecimal instance where the decimal point has been moved n places to the left. If n < 0 then the decimal point is moved -n places to the right.

The result is obtained by changing its scale. If the scale of the result becomes negative, then its precision is increased such that the scale is zero.

Note, that movePointLeft(0) returns a result which is mathematically equivalent, but which has scale >= 0.
[中]返回一个新的BigDecimal实例,其中小数点已向左移动n位。如果n<0,则小数点向右移动-n位。
结果是通过改变其比例得到的。如果结果的刻度变为负值,则其精度将增加,使刻度为零。
请注意,movePointLeft(0)返回的结果在数学上是等价的,但其比例>=0。

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Returns a new {@code BigDecimal} instance where the decimal point has
 * been moved {@code n} places to the right. If {@code n < 0} then the
 * decimal point is moved {@code -n} places to the left.
 *
 * <p>The result is obtained by changing its scale. If the scale of the result
 * becomes negative, then its precision is increased such that the scale is
 * zero.
 *
 * <p>Note, that {@code movePointRight(0)} returns a result which is
 * mathematically equivalent, but which has scale >= 0.
 */
public BigDecimal movePointRight(int n) {
  return movePoint(scale - (long)n);
}

代码示例来源:origin: robovm/robovm

/**
 * Returns a new {@code BigDecimal} instance where the decimal point has
 * been moved {@code n} places to the left. If {@code n < 0} then the
 * decimal point is moved {@code -n} places to the right.
 *
 * <p>The result is obtained by changing its scale. If the scale of the result
 * becomes negative, then its precision is increased such that the scale is
 * zero.
 *
 * <p>Note, that {@code movePointLeft(0)} returns a result which is
 * mathematically equivalent, but which has {@code scale >= 0}.
 */
public BigDecimal movePointLeft(int n) {
  return movePoint(scale + (long)n);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Returns a new {@code BigDecimal} instance where the decimal point has
 * been moved {@code n} places to the right. If {@code n < 0} then the
 * decimal point is moved {@code -n} places to the left.
 *
 * <p>The result is obtained by changing its scale. If the scale of the result
 * becomes negative, then its precision is increased such that the scale is
 * zero.
 *
 * <p>Note, that {@code movePointRight(0)} returns a result which is
 * mathematically equivalent, but which has scale >= 0.
 */
public BigDecimal movePointRight(int n) {
  return movePoint(scale - (long)n);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Returns a new {@code BigDecimal} instance where the decimal point has
 * been moved {@code n} places to the left. If {@code n < 0} then the
 * decimal point is moved {@code -n} places to the right.
 *
 * <p>The result is obtained by changing its scale. If the scale of the result
 * becomes negative, then its precision is increased such that the scale is
 * zero.
 *
 * <p>Note, that {@code movePointLeft(0)} returns a result which is
 * mathematically equivalent, but which has {@code scale >= 0}.
 */
public BigDecimal movePointLeft(int n) {
  return movePoint(scale + (long)n);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Returns a new {@code BigDecimal} instance where the decimal point has
 * been moved {@code n} places to the left. If {@code n < 0} then the
 * decimal point is moved {@code -n} places to the right.
 *
 * <p>The result is obtained by changing its scale. If the scale of the result
 * becomes negative, then its precision is increased such that the scale is
 * zero.
 *
 * <p>Note, that {@code movePointLeft(0)} returns a result which is
 * mathematically equivalent, but which has {@code scale >= 0}.
 */
public BigDecimal movePointLeft(int n) {
  return movePoint(scale + (long)n);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Returns a new {@code BigDecimal} instance where the decimal point has
 * been moved {@code n} places to the right. If {@code n < 0} then the
 * decimal point is moved {@code -n} places to the left.
 *
 * <p>The result is obtained by changing its scale. If the scale of the result
 * becomes negative, then its precision is increased such that the scale is
 * zero.
 *
 * <p>Note, that {@code movePointRight(0)} returns a result which is
 * mathematically equivalent, but which has scale >= 0.
 */
public BigDecimal movePointRight(int n) {
  return movePoint(scale - (long)n);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Returns a new {@code BigDecimal} instance where the decimal point has
 * been moved {@code n} places to the left. If {@code n < 0} then the
 * decimal point is moved {@code -n} places to the right.
 *
 * <p>The result is obtained by changing its scale. If the scale of the result
 * becomes negative, then its precision is increased such that the scale is
 * zero.
 *
 * <p>Note, that {@code movePointLeft(0)} returns a result which is
 * mathematically equivalent, but which has {@code scale >= 0}.
 */
public BigDecimal movePointLeft(int n) {
  return movePoint(scale + (long)n);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Returns a new {@code BigDecimal} instance where the decimal point has
 * been moved {@code n} places to the right. If {@code n < 0} then the
 * decimal point is moved {@code -n} places to the left.
 *
 * <p>The result is obtained by changing its scale. If the scale of the result
 * becomes negative, then its precision is increased such that the scale is
 * zero.
 *
 * <p>Note, that {@code movePointRight(0)} returns a result which is
 * mathematically equivalent, but which has scale >= 0.
 */
public BigDecimal movePointRight(int n) {
  return movePoint(scale - (long)n);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Returns a new {@code BigDecimal} instance where the decimal point has
 * been moved {@code n} places to the left. If {@code n < 0} then the
 * decimal point is moved {@code -n} places to the right.
 *
 * <p>The result is obtained by changing its scale. If the scale of the result
 * becomes negative, then its precision is increased such that the scale is
 * zero.
 *
 * <p>Note, that {@code movePointLeft(0)} returns a result which is
 * mathematically equivalent, but which has {@code scale >= 0}.
 */
public BigDecimal movePointLeft(int n) {
  return movePoint(scale + (long)n);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Returns a new {@code BigDecimal} instance where the decimal point has
 * been moved {@code n} places to the left. If {@code n < 0} then the
 * decimal point is moved {@code -n} places to the right.
 *
 * <p>The result is obtained by changing its scale. If the scale of the result
 * becomes negative, then its precision is increased such that the scale is
 * zero.
 *
 * <p>Note, that {@code movePointLeft(0)} returns a result which is
 * mathematically equivalent, but which has {@code scale >= 0}.
 */
public BigDecimal movePointLeft(int n) {
  return movePoint(scale + (long)n);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Returns a new {@code BigDecimal} instance where the decimal point has
 * been moved {@code n} places to the right. If {@code n < 0} then the
 * decimal point is moved {@code -n} places to the left.
 *
 * <p>The result is obtained by changing its scale. If the scale of the result
 * becomes negative, then its precision is increased such that the scale is
 * zero.
 *
 * <p>Note, that {@code movePointRight(0)} returns a result which is
 * mathematically equivalent, but which has scale >= 0.
 */
public BigDecimal movePointRight(int n) {
  return movePoint(scale - (long)n);
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Returns a new {@code BigDecimal} instance where the decimal point has
 * been moved {@code n} places to the left. If {@code n < 0} then the
 * decimal point is moved {@code -n} places to the right.
 *
 * <p>The result is obtained by changing its scale. If the scale of the result
 * becomes negative, then its precision is increased such that the scale is
 * zero.
 *
 * <p>Note, that {@code movePointLeft(0)} returns a result which is
 * mathematically equivalent, but which has {@code scale >= 0}.
 */
public BigDecimal movePointLeft(int n) {
  return movePoint(scale + (long)n);
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Returns a new {@code BigDecimal} instance where the decimal point has
 * been moved {@code n} places to the right. If {@code n < 0} then the
 * decimal point is moved {@code -n} places to the left.
 *
 * <p>The result is obtained by changing its scale. If the scale of the result
 * becomes negative, then its precision is increased such that the scale is
 * zero.
 *
 * <p>Note, that {@code movePointRight(0)} returns a result which is
 * mathematically equivalent, but which has scale >= 0.
 */
public BigDecimal movePointRight(int n) {
  return movePoint(scale - (long)n);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Returns a new {@code BigDecimal} instance where the decimal point has
 * been moved {@code n} places to the right. If {@code n < 0} then the
 * decimal point is moved {@code -n} places to the left.
 *
 * <p>The result is obtained by changing its scale. If the scale of the result
 * becomes negative, then its precision is increased such that the scale is
 * zero.
 *
 * <p>Note, that {@code movePointRight(0)} returns a result which is
 * mathematically equivalent, but which has scale >= 0.
 */
public BigDecimal movePointRight(int n) {
  return movePoint(scale - (long)n);
}

相关文章