Coder Social home page Coder Social logo

eos's People

Contributors

elliotwms avatar jlawrence11 avatar thebeline avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eos's Issues

No licence

There is no licence file in this repository.

Which licence is this software licensed under? Is it open source?

Change visibility of replaceVars method

Hi Jon,

Could you make one small change and make the visibility of replaceVars "public" instead of protected - it's quite a handy method for debugging and display purposes.

Love the class - very helpful!
Cheers,

Scientific notation support

Numbers input in scientific notation are not interpreted as expected. For example:

eos->solveIF('100*2e-9')

will output 191 instead of the expected 2.0e-7

As a quick fix, I performed a string replace after the variable replacement in solveIF()

// fix up scientific notation
$infix = str_ireplace("e","*10^",$infix);

I'm not sure if this will work under all conditions but I need it working for the moment.

when variable is use scientific notation,Parser::replaceVars go wrong

Hi jon,
Parser class replaceVars($infix, $vArray) method, if $vArray has value scientific notation
(like Parser::solveIF('x(1+y)',['x'=>1,'y'=>0.00000008]);
'y' will be convert into 8E-8 by php)
as follows code

if (in_array(strtolower($match[2]), array('pi', 'e'))) {
       $t = (strtolower($match[2]) == 'pi') ? pi() : exp(1);
       $infix = str_replace($match[0], $match[1] . $front . $t . $back . $match[3], $infix);
       .....
}

will go wrong.

Undefined offset

I am always getting these warnings/errors:

Notice (8): Undefined offset: 0 [APP\Vendor\eqEOS.php, line 170]

Notice (8): Undefined offset: 1 [APP\Vendor\eqEOS.php, line 167]

Notice (8): Undefined offset: 2 [APP\Vendor\eqEOS.php, line 170]

code:

$eq=new eqEOS();
$val_qty=$eq->solveIF('$width*5', 3);

Issue with evaluating if the variable have underscore "_"

Hi,

I am trying to evaluate following code.

include('matheval/eos.class.php');
$tempArr = array('abc'=>11685,'xyz_pqr'=>1169778);

$eos = new eqEOS();
$expressionToEval = '($abc)*100/($xyz_pqr)';

$tempVal = $eos->solveIF($expressionToEval,$tempArr);

It throws following fatal error.

PHP Fatal error: Uncaught exception 'Exception' with message 'Variable replacement does not exist for '$xyz' in ($abc)*100/($xyz_pqr)' in matheval/eos.class.php:365
Stack trace:
#0 temp.php(7): eqEOS->solveIF('($abc)*100...', Array)
#1 {main}

thrown in matheval/eos.class.php on line 365

So due to underscore it is creating an issue. I tried it with removing underscore and it worked.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.