Examples of RoundingMode


Examples of ca.eandb.jmist.framework.loader.openexr.attribute.TileDescription.RoundingMode

      {
        int w = dw.getXSize();
        int h = dw.getYSize();
        int tw = td.getXSize();
        int th = td.getYSize();
        RoundingMode rm = td.getRoundingMode();
        int n = 1 + round(Math.log(Math.max(w, h)) / Math.log(2.0), rm);
        numTiles = 0;
        for (int i = 0; i < n; i++) {
          int lx = round(w / Math.pow(2.0, i), rm);
          int ly = round(h / Math.pow(2.0, i), rm);
          int tx = 1 + (lx - 1) / tw;
          int ty = 1 + (ly - 1) / th;
          numTiles += tx * ty;
        }
        break;
      }

      case RIPMAP_LEVELS:
      {
        int w = dw.getXSize();
        int h = dw.getYSize();
        int tw = td.getXSize();
        int th = td.getYSize();
        RoundingMode rm = td.getRoundingMode();
        int nx = 1 + round(Math.log(w) / Math.log(2.0), rm);
        int ny = 1 + round(Math.log(h) / Math.log(2.0), rm);
        numTiles = 0;
        for (int j = 0; j < ny; j++) {
          int ly = round(h / Math.pow(2.0, j), rm);
View Full Code Here

Examples of java.math.RoundingMode

  private void initMoney(ServletConfig aConfig){
    String moneyStyle = fDecimalStyle.fetch(aConfig).getValue();
    String DELIMITER = ",";
    StringTokenizer parser = new StringTokenizer(moneyStyle, DELIMITER);
    RoundingMode rounding = RoundingMode.valueOf(parser.nextToken());
    Integer numDecimals = Integer.valueOf(parser.nextToken());
    Decimal.init(rounding, numDecimals);
  }
View Full Code Here

Examples of java.math.RoundingMode

    }

    @JRubyMethod(name = "round", optional = 2)
    public IRubyObject round(ThreadContext context, IRubyObject[] args) {
        int scale = args.length > 0 ? num2int(args[0]) : 0;
        RoundingMode mode = (args.length > 1) ? javaRoundingModeFromRubyRoundingMode(args[1]) : getRoundingMode(context.runtime);
        // JRUBY-914: Java 1.4 BigDecimal does not allow a negative scale, so we have to simulate it
        if (scale < 0) {
          // shift the decimal point just to the right of the digit to be rounded to (divide by 10**(abs(scale)))
          // -1 -> 10's digit, -2 -> 100's digit, etc.
          BigDecimal normalized = value.movePointRight(scale);
View Full Code Here

Examples of java.math.RoundingMode

        RubyBigDecimal res = handleAddSpecialValues(val);
        if (res != null) {
            return res;
        }
        RoundingMode roundMode = getRoundingMode(runtime);
        return new RubyBigDecimal(runtime, value.add(
                val.value, new MathContext(prec, roundMode))); // TODO: why this: .setResult();
    }
View Full Code Here

Examples of java.math.RoundingMode

            return null;

        try {
            Double       num    = (Double)input.get(0);
            Integer      digits = (Integer)input.get(1);
            RoundingMode mode   = (input.size() >= 3) ?
                RoundingMode.valueOf(DataType.toInteger(input.get(2))) : RoundingMode.HALF_EVEN;
            if (num == null) return null;

            BigDecimal bdnum  = BigDecimal.valueOf(num);
            bdnum = bdnum.setScale(digits, mode);
View Full Code Here

Examples of java.math.RoundingMode

            return null;

        try {
            Float        num    = (Float)input.get(0);
            Integer      digits = (Integer)input.get(1);
            RoundingMode mode   = (input.size() >= 3) ?
                RoundingMode.valueOf(DataType.toInteger(input.get(2))) : RoundingMode.HALF_EVEN;
            if (num == null) return null;

            BigDecimal bdnum  = BigDecimal.valueOf(num);
            bdnum = bdnum.setScale(digits, mode);
View Full Code Here

Examples of java.math.RoundingMode

            return null;

        try {
            Double       num    = DataType.toDouble(input.get(0));
            Integer      digits = DataType.toInteger(input.get(1));
            RoundingMode mode   = (input.size() >= 3) ?
                RoundingMode.valueOf(DataType.toInteger(input.get(2))) : RoundingMode.HALF_EVEN;
            if (num == null) return null;

            BigDecimal bdnum  = BigDecimal.valueOf(num);
            bdnum = bdnum.setScale(digits, mode);
View Full Code Here

Examples of java.math.RoundingMode

            return null;

        try {
            Double       num    = DataType.toDouble(input.get(0));
            Integer      digits = DataType.toInteger(input.get(1));
            RoundingMode mode   = (input.size() >= 3) ?
                RoundingMode.valueOf(DataType.toInteger(input.get(2))) : RoundingMode.HALF_EVEN;
            if (num == null) return null;

            BigDecimal bdnum  = BigDecimal.valueOf(num);
            bdnum = bdnum.setScale(digits, mode);
View Full Code Here

Examples of java.math.RoundingMode

            return null;

        try {
            Float        num    = (Float)input.get(0);
            Integer      digits = (Integer)input.get(1);
            RoundingMode mode   = (input.size() >= 3) ?
                RoundingMode.valueOf(DataType.toInteger(input.get(2))) : RoundingMode.HALF_EVEN;
            if (num == null) return null;

            BigDecimal bdnum  = BigDecimal.valueOf(num);
            bdnum = bdnum.setScale(digits, mode);
View Full Code Here

Examples of java.math.RoundingMode

            return null;

        try {
            Double       num    = (Double)input.get(0);
            Integer      digits = (Integer)input.get(1);
            RoundingMode mode   = (input.size() >= 3) ?
                RoundingMode.valueOf(DataType.toInteger(input.get(2))) : RoundingMode.HALF_EVEN;
            if (num == null) return null;

            BigDecimal bdnum  = BigDecimal.valueOf(num);
            bdnum = bdnum.setScale(digits, mode);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.