Package java.math

Examples of java.math.BigInteger.floatValue()


  }
 
  @Test public void bigIntAndFloat() {
    BigInteger big = new BigInteger("9999999999999999999999999999999999999999999999");
    float fl = 9876543210.0123456789f;
    float bigf = big.floatValue();
   
    promoter.promote( big, fl );
    promotionTester( promoter, bigf, fl );
   
    promoter.promote( fl, big);
View Full Code Here


      BigInteger asBigInt = convertLongToUlong(valueAsLong);

      // TODO: Check for overflow

      return asBigInt.floatValue();
    case MysqlDefs.FIELD_TYPE_FLOAT:

      return this.thisRow.getNativeFloat(columnIndex);

    default:
View Full Code Here

  }
 
  @Test public void bigIntAndFloat() {
    BigInteger big = new BigInteger("9999999999999999999999999999999999999999999999");
    float fl = 9876543210.0123456789f;
    float bigf = big.floatValue();
   
    promoter.promote( big, fl );
    promotionTester( promoter, bigf, fl );
   
    promoter.promote( fl, big);
View Full Code Here

        } else {
            maxTextField.setText("");
        }
        if (min != null && max != null) {
            BigInteger range = max.subtract(min);
            rangeTextField.setText(Float.toString(range.floatValue()));
        } else {
            rangeTextField.setText("");
        }
    }
   
View Full Code Here

     
      BigInteger asBigInt = convertLongToUlong(valueAsLong);
     
      // TODO: Check for overflow
     
      return asBigInt.floatValue();
    case MysqlDefs.FIELD_TYPE_FLOAT:
     
      return this.thisRow.getNativeFloat(columnIndex);

    default:
View Full Code Here

        BigInteger bi1 = new BigInteger("1234567890abcdef1234567890abcdef12345678", 16);
        Number160 ki1 = new Number160("0x1234567890abcdef1234567890abcdef12345678");
        BigInteger bi2 = new BigInteger("357116889007843534245232322114545905234a", 16);
        Number160 ki2 = new Number160("0x357116889007843534245232322114545905234a");
        Assert.assertEquals(0, Float.compare(bi1.floatValue(), ki1.floatValue()));
        Assert.assertEquals(0, Float.compare(bi2.floatValue(), ki2.floatValue()));
    }

    @Test
    public void testPerformance() {
        int runs = 10000;
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.