Package org.jscience.mathematics.number

Examples of org.jscience.mathematics.number.Number


  @Override
  public ParseResult parse(final TokenList tokens, final int templatePos) {
   
    final String op = (String) tokens.get(templatePos);
    final LargeInteger input = (LargeInteger) tokens.get(templatePos + 1);
    Number result = null;
   
    if(op.equals("factorial")){
      //System.out.println("INput is: "+input);
     
      if(input.isLessThan(LargeInteger.valueOf(20)) && input.isGreaterThan(LargeInteger.ZERO)){
View Full Code Here


  @SuppressWarnings("rawtypes")
  @Override
  public ParseResult parse(final TokenList tokens, final int templatePos) {
    final String op = (String) tokens.get(templatePos);
    final Number number = (Number) tokens.get(templatePos + 1);
    Number result = null;
    if (op.equals("-") && (templatePos == 0 || !(tokens.get(templatePos-1) instanceof Number))) {
      result = (Number) number.opposite();
    } else if (op.equals("sqrt")) {
      result = FloatingPoint.valueOf(Math.sqrt(number.doubleValue()));
    } else if (op.equals("abs")) {
View Full Code Here

TOP

Related Classes of org.jscience.mathematics.number.Number

Copyright © 2018 www.massapicom. 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.