<?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;
<?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;
<?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;
<?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;
<?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;