Esempio n. 1
0
File: mul.php Progetto: dollavon/pni
<?php

try {
    $mul = new PNIFunction(PNIDataType::DOUBLE, 'PNI_mul', '/root/local/lib/libpnimath.so');
    $a = new PNIDouble(100);
    $b = new PNIDouble(50);
    $res = $mul->invoke($a, $b);
    var_dump($res);
} catch (PNIException $e) {
    var_dump($e->getMessage());
    var_dump($e->getTraceAsString());
}
exit;
Esempio n. 2
0
File: div.php Progetto: dollavon/pni
<?php

try {
    $div = new PNIFunction(PNIDataType::DOUBLE, 'PNI_div', '/root/local/lib/libpnimath.so');
    $a = new PNIDouble(100);
    $b = new PNIInteger(50);
    $res = $div->invoke($a, $b);
    var_dump($res);
} catch (PNIException $e) {
    var_dump($e->getMessage());
    var_dump($e->getTraceAsString());
}
exit;
Esempio n. 3
0
File: add.php Progetto: dollavon/pni
<?php

try {
    $add = new PNIFunction(PNIDataType::LONG, 'PNI_add', '/root/local/lib/libpnimath.so');
    $a = new PNILong(100);
    $b = new PNILong(10);
    $res = $add->invoke($a, $b);
    var_dump($res);
} catch (PNIException $e) {
    var_dump($e->getMessage());
    var_dump($e->getTraceAsString());
}
exit;
Esempio n. 4
0
<?php

try {
    $log = new PNIFunction(PNIDataType::INTEGER, 'PNI_log', '/root/local/lib/libpnimath.so');
    $integer = new PNIInteger(100);
    $res = $log->invoke($integer);
    var_dump($res);
} catch (PNIException $e) {
    var_dump($e->getMessage());
    var_dump($e->getTraceAsString());
}
exit;
Esempio n. 5
0
File: log.php Progetto: dollavon/pni
<?php

try {
    $log = new PNIFunction(PNIDataType::DOUBLE, 'log10', 'libm.so.6');
    $a = new PNIDouble(1.0E+26);
    $b = new PNIDouble(10);
    $res = $log->invoke($a);
    var_dump($res);
    $res = $log->invoke($b);
    var_dump($res);
    var_dump($log->invoke($a) / $log->invoke($b));
} catch (PNIException $e) {
    var_dump($e->getMessage());
    var_dump($e->getTraceAsString());
}
exit;