Examples of Arithmetic


Examples of ch.njol.skript.classes.Arithmetic

          } else {
            final Class<?> c = o.getClass();
            assert c != null;
            ci = Classes.getSuperClassInfo(c);
          }
          Arithmetic a = null;
          final Changer<?> changer;
          final Class<?>[] cs;
          if (o == null || ci == null || (a = ci.getMath()) != null) {
            boolean changed = false;
            for (final Object d : delta) {
              if (o == null || ci == null) {
                final Class<?> c = d.getClass();
                assert c != null;
                ci = Classes.getSuperClassInfo(c);
                if (ci.getMath() != null)
                  o = d;
                changed = true;
                continue;
              }
              final Class<?> r = ci.getMathRelativeType();
              assert a != null && r != null : ci;
              final Object diff = Converters.convert(d, r);
              if (diff != null) {
                if (mode == ChangeMode.ADD)
                  o = a.add(o, diff);
                else
                  o = a.subtract(o, diff);
                changed = true;
              }
            }
            if (changed)
              set(e, o);
View Full Code Here

Examples of com.cburch.logisim.std.arith.Arithmetic

    libraries = Arrays.asList(new Library[] {
      new Base(),
      new Gates(),
      new Wiring(),
      new Plexers(),
      new Arithmetic(),
      new Memory(),
      new Io(),
    });
  }
View Full Code Here

Examples of com.cburch.logisim.std.arith.Arithmetic

        libraries = Arrays.asList(new Library[] {
            new Base(),
            new Gates(),
            new Wiring(),
            new Plexers(),
            new Arithmetic(),
            new Memory(),
            new Io(),
        });
    }
View Full Code Here

Examples of org.candle.decompiler.intermediate.expression.Arithmetic

  protected void processArithmeticTwoStackOperations(ArithmeticType type) {
    Expression right = context.getExpressions().pop();
    Expression left = context.getExpressions().pop();
   
    Expression addExp = new Arithmetic(context.getCurrentInstruction(), left, right, type);
    context.getExpressions().push(addExp);
  }
View Full Code Here

Examples of org.openiaml.model.model.operations.Arithmetic

    setGeneratedBy(node, by);
    return node;
  }

  public Arithmetic generatedArithmetic(GeneratesElements by, ActivityOperation container) throws InferenceException {
    Arithmetic node = (Arithmetic) createElement( container, OperationsPackage.eINSTANCE.getArithmetic(), OperationsPackage.eINSTANCE.getActivityOperation_Nodes() );
    setGeneratedBy(node, by);
    return node;
  }
View Full Code Here

Examples of org.openiaml.model.model.operations.Arithmetic

    setGeneratedBy(node, by);
    return node;
  }
 
  public Arithmetic generatedArithmetic(GeneratesElements by, ActivityPredicate container) throws InferenceException {
    Arithmetic node = (Arithmetic) createElement( container, OperationsPackage.eINSTANCE.getArithmetic(), OperationsPackage.eINSTANCE.getActivityPredicate_Nodes() );
    setGeneratedBy(node, by);
    return node;
  }
View Full Code Here

Examples of org.openiaml.model.model.operations.Arithmetic

    SetNode set = assertHasSetNode(op);

    assertGenerated(assertHasExecutionEdge(op, start, set));
    assertGenerated(assertHasExecutionEdge(op, set, finish));

    Arithmetic arith = assertHasArithmetic(op);
    Value one = assertHasValue(op, "one");
    assertTrue(one.isReadOnly());
    assertEquals(arith.getOperationType(), ArithmeticOperationTypes.SUBTRACT);

    // arith <- ExternalValue <- results
    // arith <- ExternalValue <- one
    {
      assertEquals(2, arith.getInFlows().size());
      boolean fromResults = false;
      boolean fromOne = false;
      for (DataFlowEdge ee : arith.getInFlows()) {
        assertInstanceOf(ExternalValue.class, ee.getFrom());
        ExternalValue ev = (ExternalValue) ee.getFrom();
       
        if (one.equals(ev.getValue())) {
          assertFalse(fromOne);
          fromOne = true;
        } else if (results.equals(ev.getValue())) {
          assertFalse(fromResults);
          fromResults = true;
        } else {
          fail("Unknown source: " + ev.getValue());
        }
      }
      assertTrue(fromOne);
      assertTrue(fromResults);
    }
   
    // arith -> ExternalValue -> set
    {
      assertEquals(1, arith.getOutFlows().size());
      assertEquals(set, arith.getOutFlows().get(0).getTo());
    }

    assertGenerated(assertHasDataFlowEdge(op, arith, set));
   
    // set -> ExternalValue -> target
View Full Code Here

Examples of r.nodes.exec.Arithmetic

    public RNode create(ASTNode call, RSymbol[] names, RNode[] exprs) {
        ArgumentInfo ia = check(call, names, exprs);
        final int digitsPosition = ia.position("digits");

        if (digitsPosition == -1) {
            return new Arithmetic(call,  exprs[0], new Constant(call, RDouble.BOXED_ZERO), ROUND_JAVA);
        }
        if (digitsPosition == 1) {
            return new Arithmetic(call,  exprs[0], exprs[1], ROUND_JAVA);
        }
        // digitsPosition == 0;
        return new Arithmetic(call,  exprs[1], exprs[0], ROUND_JAVA);
    }
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.