本文整理了Java中php.runtime.Memory.div()
方法的一些代码示例,展示了Memory.div()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Memory.div()
方法的具体详情如下:
包路径:php.runtime.Memory
类名称:Memory
方法名:div
暂无
代码示例来源:origin: jphp-group/jphp
@Override
public Memory invoke(Memory o1, Memory o2) {
return o1.div(o2);
}
}, callCache, cacheIndex);
代码示例来源:origin: jphp-group/jphp
@Override
public Memory calc(Environment env, TraceInfo trace, Memory o1, Memory o2) {
return o1.div(o2);
}
}
代码示例来源:origin: jphp-group/jphp
public Memory divRight(boolean value){ if(!value) return CONST_INT_0; else return TRUE.div(this); }
public Memory divRight(String value){ return StringMemory.toNumeric(value).div(this); }
代码示例来源:origin: jphp-group/jphp
@Override
public Memory div(Memory memory) {
return toNumeric().div(memory);
}
代码示例来源:origin: jphp-group/jphp
@Override
public Memory div(double value) {
return this.getValue().div(value);
}
代码示例来源:origin: jphp-group/jphp
@Override
public Memory div(Memory memory) {
return toNumeric().div(memory);
}
代码示例来源:origin: jphp-group/jphp
@Override
public Memory div(double value) {
return toNumeric().div(value);
}
代码示例来源:origin: jphp-group/jphp
@Override
public Memory div(boolean value) {
return this.getValue().div(value);
}
代码示例来源:origin: jphp-group/jphp
@Override
public Memory div(String value) {
return this.getValue().div(value);
}
代码示例来源:origin: jphp-group/jphp
@Override
public Memory div(long value) {
return toNumeric().div(value);
}
代码示例来源:origin: jphp-group/jphp
@Override
public Memory div(Memory memory) {
return toNumeric().div(memory);
}
代码示例来源:origin: jphp-group/jphp
@Override
public Memory div(Memory memory) {
return getValue().div(memory);
}
代码示例来源:origin: jphp-group/jphp
@Override
public Memory div(long value) {
return this.getValue().div(value);
}
代码示例来源:origin: jphp-group/jphp
@Override
public Memory div(String value) {
return toNumeric().div(value);
}
代码示例来源:origin: jphp-group/jphp
public Memory assignDiv(String memory) { return assign(div(memory)); }
public Memory assignDivRight(Memory memory) { return memory.assign(memory.div(this)); }
代码示例来源:origin: jphp-group/jphp
public Memory assignDiv(Memory memory) { return assign(div(memory)); }
public Memory assignDiv(long memory) { return assign(div(memory)); }
代码示例来源:origin: jphp-group/jphp
public Memory assignDiv(long memory) { return assign(div(memory)); }
public Memory assignDiv(double memory) { return assign(div(memory)); }
代码示例来源:origin: jphp-group/jphp
@Signature(@Arg(value = "comparator", type = HintType.CALLABLE, optional = @Optional("null")))
public Memory numMedian(Environment env, Memory... args) {
List<Memory> list = sort(env, args[0])
.toValue(ArrayMemory.class)
.stream().collect(Collectors.toList());
if (list.isEmpty()) return Memory.NULL;
if (list.size() % 2 == 0) {
return list.get(list.size() / 2).plus(list.get(list.size() / 2 + 1)).div(Memory.CONST_INT_2).toNumeric();
} else {
return list.get(list.size() / 2).toNumeric();
}
}
代码示例来源:origin: jphp-group/jphp
@Signature
public Memory avg(Environment env, Memory... args) {
Memory result = Memory.CONST_INT_0;
int cnt = 0;
for (Memory memory : getSelfIterator(env)) {
result = result.plus(memory);
cnt++;
}
return result.div(LongMemory.valueOf(cnt));
}
代码示例来源:origin: jphp-group/jphp
@Override
public Memory div(Memory memory) {
switch (memory.type){
case DOUBLE: return new DoubleMemory(1 / ((DoubleMemory)memory).value);
case REFERENCE: return div(memory.toValue());
default:
return CONST_INT_1.div(memory.toNumeric());
}
}
内容来源于网络,如有侵权,请联系作者删除!