php.runtime.Memory.mul()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中php.runtime.Memory.mul()方法的一些代码示例,展示了Memory.mul()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Memory.mul()方法的具体详情如下:
包路径:php.runtime.Memory
类名称:Memory
方法名:mul

Memory.mul介绍

暂无

代码示例

代码示例来源:origin: jphp-group/jphp

@Override
  public Memory invoke(Memory o1, Memory o2) {
    return o1.mul(o2);
  }
}, callCache, cacheIndex);

代码示例来源:origin: jphp-group/jphp

@Override
  public Memory calc(Environment env, TraceInfo trace, Memory o1, Memory o2) {
    return o1.mul(o2);
  }
}

代码示例来源:origin: jphp-group/jphp

public static Memory mul(boolean o1, Memory value) {
  return o1 ? Memory.TRUE.mul(value) : Memory.FALSE.mul(value);
}

代码示例来源:origin: jphp-group/jphp

@Override
public Memory mul(Memory memory) {
  return toNumeric().mul(memory);
}

代码示例来源:origin: jphp-group/jphp

@Override
public Memory mul(Memory memory) {
  return getValue().mul(memory);
}

代码示例来源:origin: jphp-group/jphp

@Override
public Memory mul(double value) {
  return this.getValue().mul(value);
}

代码示例来源:origin: jphp-group/jphp

@Override
public Memory mul(String value) {
  return this.getValue().mul(value);
}

代码示例来源:origin: jphp-group/jphp

@Override
public Memory mul(long value) {
  return this.getValue().mul(value);
}

代码示例来源:origin: jphp-group/jphp

@Override
public Memory mul(boolean value) {
  return this.getValue().mul(value);
}

代码示例来源:origin: jphp-group/jphp

@Override
public Memory mul(Memory memory) {
  return toNumeric().mul(memory);
}

代码示例来源:origin: jphp-group/jphp

@Override
public Memory mul(Memory memory) {
  return toNumeric().mul(memory);
}

代码示例来源:origin: jphp-group/jphp

public Memory assignMul(double memory) { return assign(mul(memory)); }
public Memory assignMul(boolean memory) { return assign(mul(memory)); }

代码示例来源:origin: jphp-group/jphp

public Memory assignMul(long memory) { return assign(mul(memory)); }
public Memory assignMul(double memory) { return assign(mul(memory)); }

代码示例来源:origin: jphp-group/jphp

public Memory assignMul(boolean memory) { return assign(mul(memory)); }
public Memory assignMul(String memory) { return assign(mul(memory)); }

代码示例来源:origin: jphp-group/jphp

public Memory assignMul(String memory) { return assign(mul(memory)); }
public Memory assignMulRight(Memory memory) { return memory.assign(memory.mul(this)); }

代码示例来源:origin: jphp-group/jphp

public Memory assignMulRight(Memory memory) { return memory.assign(memory.mul(this)); }

代码示例来源:origin: jphp-group/jphp

public Memory assignMul(Memory memory) { return assign(mul(memory)); }
public Memory assignMul(long memory) { return assign(mul(memory)); }

代码示例来源:origin: jphp-group/jphp

public Memory mul(String value){ return mul(StringMemory.toNumeric(value)); }

代码示例来源:origin: jphp-group/jphp

public static Memory array_product(Environment env, TraceInfo trace, Memory input) {
  if (expecting(env, trace, 1, input, ARRAY)) {
    ForeachIterator iterator = input.getNewIterator(env, false, false);
    Memory result = Memory.CONST_INT_1;
    while (iterator.next()) {
      result = result.mul(iterator.getValue());
    }
    return result;
  } else
    return Memory.NULL;
}

代码示例来源:origin: jphp-group/jphp

@Test
public void testMul(){
  Assert.assertEquals(1, Memory.TRUE.mul(Memory.CONST_INT_1).toLong());
  Assert.assertTrue(Memory.TRUE.mul(Memory.CONST_INT_1) instanceof LongMemory);
  Assert.assertEquals(1.0, Memory.TRUE.mul(Memory.CONST_DOUBLE_1).toDouble(), 0.00001);
  Assert.assertTrue(Memory.TRUE.mul(Memory.CONST_DOUBLE_1) instanceof DoubleMemory);
  Assert.assertEquals(1, Memory.TRUE.mul(Memory.TRUE).toLong());
  Assert.assertTrue(Memory.TRUE.mul(Memory.TRUE) instanceof LongMemory);
  Assert.assertEquals(0, Memory.TRUE.mul(Memory.FALSE).toLong());
  Assert.assertTrue(Memory.TRUE.mul(Memory.FALSE) instanceof LongMemory);
  Assert.assertEquals(1, Memory.TRUE.mul(true).toLong());
  Assert.assertTrue(Memory.TRUE.mul(true) instanceof LongMemory);
  Assert.assertEquals(0, Memory.TRUE.mul(false).toLong());
  Assert.assertTrue(Memory.TRUE.mul(false) instanceof LongMemory);
  Assert.assertEquals(2, Memory.TRUE.mul(2).toLong());
  Assert.assertTrue(Memory.TRUE.mul(2) instanceof LongMemory);
  Assert.assertEquals(0.5, Memory.TRUE.mul(0.5).toDouble(), 0.00001);
}

相关文章