Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing solutions for variable inference. #98

Open
NatanFreeman opened this issue Sep 22, 2022 · 1 comment
Open

Missing solutions for variable inference. #98

NatanFreeman opened this issue Sep 22, 2022 · 1 comment

Comments

@NatanFreeman
Copy link

When using eval to parse variable's to the power only positive values are considered.

use kalk::parser;

fn main() {
    let mut parser_context = parser::Context::new();
    let result = parser::eval(&mut parser_context, &"x^2=4")
        .unwrap()
        .unwrap();

    println!("{}", result);
}

Outputs:

2

This is missing the solution x=-2.

@PaddiM8
Copy link
Owner

PaddiM8 commented Sep 22, 2022

It does indeed only return one of the solutions when estimating solutions to equations. I guess it would be possible to make it return a vector of solutions in cases where there are several of them, but I'm not sure it would be able to find them all consistently and efficiently. Will look in to it more though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants