-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy path_fdiv.php
More file actions
29 lines (24 loc) · 812 Bytes
/
_fdiv.php
File metadata and controls
29 lines (24 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
declare(strict_types=1);
namespace PHPJava\Kernel\Mnemonics;
use PHPJava\Kernel\Filters\Normalizer;
use PHPJava\Kernel\Types\Float_;
final class _fdiv extends AbstractOperationCode implements OperationCodeInterface
{
protected $isStackingOperation = true;
public function getOperands(): ?Operands
{
parent::getOperands();
if ($this->operands !== null) {
return $this->operands;
}
return $this->operands = new Operands();
}
public function execute(): void
{
parent::execute();
$value2 = (float) Normalizer::getPrimitiveValue($this->popFromOperandStack());
$value1 = (float) Normalizer::getPrimitiveValue($this->popFromOperandStack());
$this->pushToOperandStack(Float_::get($value1 / $value2));
}
}