Repository navigation
Support for equation systems - #183
Conversation
A user reported that kalker outputs `0b0.001 = 0.1_2`. The problem was coming from `to_radix`pretty` After this commit, kalker outputs correcty `0b0.001 = 0.001_2`
|
I think I need to write some doc to explain what were my choices and where are the differents parts of the code/what they do. Do you have an idea where I can do so ? |
PaddiM8
left a comment
There was a problem hiding this comment.
Wow this is really cool actually. I have a few minor suggestions but apart from that I think it looks good.
I agree that it would be good to document it a bit. I like to keep it in the code, like above function(s) with /// syntax even if it goes quite deeply into detail. And maaybe a link to some description of the algorithm in a comment for eval_equation_system.
| numerical::find_root(context, &expr, &unknown_var.full_name) | ||
| } | ||
|
|
||
| fn eval_equation_system( |
There was a problem hiding this comment.
There are some similar functions in numerical.rs so it might make sense it to place this function in that file as well
There was a problem hiding this comment.
Ok, I will change the location of the function !
There was a problem hiding this comment.
I just checked, but it seems that there are no "eval_..." function declared in numerical.rs. They are all in interpreter.rs. Are you sure you want me to move the function ?
There was a problem hiding this comment.
Oh sorry, I meant moving the logic to numerical.rs but yeah there would still be a eval_equation_system function in interpreter.rs. Similar to eval_equation in interpreter.rs, which calls find_root in numerical.rs.
There was a problem hiding this comment.
I've just moved almost everything to numerical.rs, so now eval_equation_system really looks like eval_equation
What do you think of that ?
Co-authored-by: PaddiM8 <github@bakk.dev>
Here is a support for equation systems as discussed in #182
The syntax is simple, the equation system begin with
{, end with}and equations are separed with;(it is optionnal but possible to use a new line for each equation, the;remains needed)Here is a simple example :