Java in a Nutshell, 5th Edition [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Java in a Nutshell, 5th Edition [Electronic resources] - نسخه متنی

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید


RoundingModejava.math

Java 5.0serializable comparable enum

The

constants
defined by this enumerated type represent possible ways of rounding
numbers. UP and DOWN specify
rounding away from zero or toward zero. CEILING
and FLOOR represent rounding toward positive
infinity and negative infinity. HALF_UP,
HALF_DOWN, and HALF_EVEN all
round toward the nearest value and differ only in what they do when
two values are equidistant. In this case, they round up, down, or to
the "even" neighbor.
UNNECESSARY is a special rounding mode that serves
as an assertion that an arithmetic operation will have an exact
result and that rounding is not needed. If this assertion
failsthat is, if the operation does require roundingan
ArithmeticException is thrown.


Figure 11-4. java.math.RoundingMode

public enum

RoundingMode {
// Enumerated Constants

UP ,

DOWN ,

CEILING ,

FLOOR ,

HALF_UP ,

HALF_DOWN ,

HALF_EVEN ,

UNNECESSARY ;
// Public Class Methods
public static RoundingMode

valueOf (int

rm );
public static RoundingMode

valueOf (String

name );
public static final RoundingMode[ ]

values ( );
}


Passed To


BigDecimal.{divide( ), setScale(
)}, MathContext.MathContext( )

Returned By


MathContext.getRoundingMode( )


    / 1191