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

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

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

Memory.mod介绍

暂无

代码示例

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

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

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

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

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

@Test
public void testMod(){
  Assert.assertEquals(0, Memory.TRUE.mod(Memory.CONST_INT_1).toLong());
  Assert.assertTrue(Memory.TRUE.mod(Memory.CONST_INT_1) instanceof LongMemory);
  Assert.assertEquals(0, Memory.TRUE.mod(Memory.CONST_DOUBLE_1).toDouble(), 0.00001);
  Assert.assertTrue(Memory.TRUE.mod(Memory.CONST_DOUBLE_1) instanceof LongMemory);
  Assert.assertEquals(0, Memory.TRUE.mod(Memory.TRUE).toLong());
  Assert.assertTrue(Memory.TRUE.mod(Memory.TRUE) instanceof LongMemory);
  Assert.assertEquals(0, Memory.TRUE.mod(Memory.FALSE).toLong());
  Assert.assertTrue(Memory.TRUE.mod(Memory.FALSE) instanceof FalseMemory);
  Assert.assertEquals(0, Memory.TRUE.mod(true).toLong());
  Assert.assertTrue(Memory.TRUE.mod(true) instanceof LongMemory);
  Assert.assertEquals(0, Memory.TRUE.mod(false).toLong());
  Assert.assertTrue(Memory.TRUE.mod(false) instanceof FalseMemory);
  Assert.assertEquals(1, Memory.TRUE.mod(2).toLong());
  Assert.assertTrue(Memory.TRUE.mod(2) instanceof LongMemory);
  Assert.assertTrue(Memory.TRUE.mod(0.5) instanceof FalseMemory);
  Assert.assertEquals(0, Memory.TRUE.modRight(true).toLong());
  Assert.assertTrue(Memory.TRUE.modRight(false).toLong() == 0);
  Assert.assertTrue(Memory.TRUE.modRight(false) instanceof LongMemory);
  Assert.assertEquals(0, Memory.TRUE.modRight(true).toLong());
  Assert.assertTrue(Memory.TRUE.modRight(true) instanceof LongMemory);
  Assert.assertTrue(Memory.TRUE.modRight(1) instanceof LongMemory);
  Assert.assertTrue(Memory.TRUE.modRight(1).toLong() == 0);
  Assert.assertTrue(Memory.TRUE.modRight(1.0) instanceof LongMemory);
  Assert.assertEquals(0, Memory.TRUE.modRight(1.3).toDouble(), 0.000001);
}

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

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

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

public Memory mod(double value){ return mod((long) value); }
public Memory mod(boolean value){ if (!value) return _divByZero(); return LongMemory.valueOf(toLong() % 1); }

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

public Memory modRight(Memory value){ return value.mod(this); }
public Memory modRight(long value){ return LongMemory.valueOf(value).mod(this); }

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

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

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

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

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

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

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

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

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

public Memory assignMod(String memory) { return assign(mod(memory)); }
public Memory assignModRight(Memory memory) { return memory.assign(memory.mod(this)); }

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

public Memory modRight(String value){ return StringMemory.toNumeric(value).mod(this); }

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

public Memory assignMod(double memory) { return assign(mod(memory)); }
public Memory assignMod(boolean memory) { return assign(mod(memory)); }

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

public Memory assignMod(boolean memory) { return assign(mod(memory)); }
public Memory assignMod(String memory) { return assign(mod(memory)); }

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

public Memory assignMod(Memory memory) { return assign(mod(memory)); }
public Memory assignMod(long memory) { return assign(mod(memory)); }

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

public Memory assignMod(long memory) { return assign(mod(memory)); }
public Memory assignMod(double memory) { return assign(mod(memory)); }

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

public Memory modRight(long value){ return LongMemory.valueOf(value).mod(this); }
public Memory modRight(double value){ return new DoubleMemory(value).mod(this); }

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

public Memory modRight(boolean value){ return LongMemory.valueOf((value ? 1 : 0)).mod(this); }
public Memory modRight(String value){ return StringMemory.toNumeric(value).mod(this); }

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

public Memory assignModRight(Memory memory) { return memory.assign(memory.mod(this)); }

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

public Memory mod(String value){ return mod(StringMemory.toNumeric(value, true, CONST_INT_0)); }

相关文章