Examples of floatValue()


Examples of java.math.BigDecimal.floatValue()

                temp=((((int)data & 0xFF)-128)/16.0); }
            break;
        }
        BigDecimal bd=new BigDecimal(temp);
        BigDecimal result=bd.setScale(2, RoundingMode.HALF_DOWN);
        return result.floatValue();
    }

    /** Calculate time as hh:mm:ss
     * @param t   number of seconds since midnight for start of sweep
     * @param t0  time in seconds from start of sweep
View Full Code Here

Examples of java.math.BigDecimal.floatValue()

   static float calcNyquist(int prf, int wave) {
        double tmp=(prf*wave*0.01)*0.25;
        tmp=tmp*0.01;                    //Make it m/sec
        BigDecimal bd=new BigDecimal(tmp);
        BigDecimal result=bd.setScale(2, RoundingMode.HALF_DOWN);
        return result.floatValue();
    }


    // dummy implementations of other methods
    public Array readNestedData(Variable v2, List section) throws IOException, InvalidRangeException {
View Full Code Here

Examples of java.math.BigDecimal.floatValue()

   * @return rounded float value
   */
  public static float round(float value, int decimalPlace) {
    BigDecimal bd = new BigDecimal(value);
    bd = bd.setScale(decimalPlace,BigDecimal.ROUND_HALF_UP);
    value = bd.floatValue();
    return value;
  }
 
  /**
   * Format a float as string with given number of figures after
View Full Code Here

Examples of java.math.BigDecimal.floatValue()

            {
                return Short.valueOf(value.shortValue());
            }
            else if (getJavaTypeMapping().getJavaType().getName().equals(ClassNameConstants.JAVA_LANG_FLOAT))
            {
                return Float.valueOf(value.floatValue());
            }
            else if (getJavaTypeMapping().getJavaType().getName().equals(ClassNameConstants.JAVA_LANG_DOUBLE))
            {
                return Double.valueOf(value.doubleValue());
            }
View Full Code Here

Examples of java.math.BigDecimal.floatValue()

        return values.get(index);
      case SUM:
        BigDecimal sum = new BigDecimal(0);
        for (int i = 0; i < values.size(); ++i)
          sum = sum.add(new BigDecimal(values.get(i)));
        return sum.floatValue();
      case MIN:
        BigDecimal minimum = new BigDecimal(values.get(0));
        for (int i = 1; i < values.size(); ++i)
          if (minimum.compareTo(new BigDecimal(values.get(i))) > 0)
            minimum = new BigDecimal(values.get(i));
View Full Code Here

Examples of java.math.BigDecimal.floatValue()

      case MIN:
        BigDecimal minimum = new BigDecimal(values.get(0));
        for (int i = 1; i < values.size(); ++i)
          if (minimum.compareTo(new BigDecimal(values.get(i))) > 0)
            minimum = new BigDecimal(values.get(i));
        return minimum.floatValue();
      case MAX:
        BigDecimal maximum = new BigDecimal(values.get(0));
        for (int i = 1; i < values.size(); ++i)
          if (maximum.compareTo(new BigDecimal(values.get(i))) < 0)
            maximum = new BigDecimal(values.get(i));
View Full Code Here

Examples of java.math.BigDecimal.floatValue()

      case MAX:
        BigDecimal maximum = new BigDecimal(values.get(0));
        for (int i = 1; i < values.size(); ++i)
          if (maximum.compareTo(new BigDecimal(values.get(i))) < 0)
            maximum = new BigDecimal(values.get(i));
        return maximum.floatValue();
      case FIRST:
        return values.get(0);
      case LAST:
        return values.get(values.size() - 1);
      default:
View Full Code Here

Examples of java.math.BigInteger.floatValue()

            // float, 16-bytes left of decimal, 16 right
            // I don't get how apple does this, so I'm just reading
            // the integer part
            raf.read (buffy, 0, 2);
            longConverter = new BigInteger (buffy);
            float mediaRate = longConverter.floatValue();
            raf.read (buffy, 0, 2);
            // make an Edit object
            Edit edit = new Edit (trackDuration, mediaTime, mediaRate);
            edits[i] = edit;
        }
View Full Code Here

Examples of java.util.Date.floatValue()

         mvalue = SimpleValueSupport.wrap(jvalue);
      }
      else if(metaType.equals(SimpleMetaType.FLOAT_PRIMITIVE))
      {
         Float jvalue = Float.valueOf(value);
         float primitive = jvalue.floatValue();
         mvalue = SimpleValueSupport.wrap(primitive);
      }
      else if(metaType.equals(SimpleMetaType.INTEGER))
      {
         Integer jvalue = Integer.valueOf(value);
View Full Code Here

Examples of krati.io.serializer.FloatSerializer.floatValue()

    public void testCustomApi() {
        FloatSerializer serializer = createSerializer();
       
        float val = 0;
        assertEquals(val, serializer.floatValue(serializer.floatBytes(val)));
        val = minValue();
        assertEquals(val, serializer.floatValue(serializer.floatBytes(val)));
        val = maxValue();
        assertEquals(val, serializer.floatValue(serializer.floatBytes(val)));
        val = anyValue();
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.