File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22namespace PHPJava \Kernel \Mnemonics ;
33
44use PHPJava \Exceptions \NotImplementedException ;
5+ use PHPJava \Kernel \Types \_Float ;
6+ use PHPJava \Utilities \BinaryTool ;
7+ use PHPJava \Utilities \Extractor ;
58
69final class _fadd implements OperationInterface
710{
@@ -10,6 +13,16 @@ final class _fadd implements OperationInterface
1013
1114 public function execute (): void
1215 {
13- throw new NotImplementedException (__CLASS__ );
16+ $ rightValue = $ this ->popFromOperandStack ();
17+ $ leftValue = $ this ->popFromOperandStack ();
18+
19+ $ this ->pushToOperandStack (
20+ _Float::get (
21+ BinaryTool::add (
22+ Extractor::getRealValue ($ leftValue ),
23+ Extractor::getRealValue ($ rightValue )
24+ )
25+ )
26+ );
1427 }
1528}
Original file line number Diff line number Diff line change 22namespace PHPJava \Kernel \Mnemonics ;
33
44use PHPJava \Exceptions \NotImplementedException ;
5+ use PHPJava \Kernel \Types \_Float ;
6+ use PHPJava \Kernel \Types \_Int ;
7+ use PHPJava \Utilities \BinaryTool ;
8+ use PHPJava \Utilities \Extractor ;
59
610final class _fmul implements OperationInterface
711{
@@ -10,6 +14,16 @@ final class _fmul implements OperationInterface
1014
1115 public function execute (): void
1216 {
13- throw new NotImplementedException (__CLASS__ );
17+ $ value2 = $ this ->popFromOperandStack ();
18+ $ value1 = $ this ->popFromOperandStack ();
19+
20+ $ this ->pushToOperandStack (
21+ _Float::get (
22+ BinaryTool::multiply (
23+ Extractor::getRealValue ($ value1 ),
24+ Extractor::getRealValue ($ value2 )
25+ )
26+ )
27+ );
1428 }
1529}
Original file line number Diff line number Diff line change 22namespace PHPJava \Kernel \Mnemonics ;
33
44use PHPJava \Exceptions \NotImplementedException ;
5+ use PHPJava \Kernel \Types \_Float ;
6+ use PHPJava \Utilities \BinaryTool ;
7+ use PHPJava \Utilities \Extractor ;
58
69final class _fsub implements OperationInterface
710{
@@ -10,6 +13,16 @@ final class _fsub implements OperationInterface
1013
1114 public function execute (): void
1215 {
13- throw new NotImplementedException (__CLASS__ );
16+ $ rightValue = $ this ->popFromOperandStack ();
17+ $ leftValue = $ this ->popFromOperandStack ();
18+
19+ $ this ->pushToOperandStack (
20+ _Float::get (
21+ BinaryTool::sub (
22+ Extractor::getRealValue ($ leftValue ),
23+ Extractor::getRealValue ($ rightValue )
24+ )
25+ )
26+ );
1427 }
1528}
You can’t perform that action at this time.
0 commit comments