Closed olback closed 3 years ago
Hi,
I tried to run eval_float_with_context_mut("PI", &mut context)
but get an Err
value: VariableIdentifierNotFound("PI")'
.
The same goes for eval_float_with_context_mut("f64::consts::PI", &mut context)
.
What's the correct way to use the consts?
I see. I need to do this first:
let context = math_consts_context!(
PI
).unwrap();
But shouldn't this be the default for HashMapContext::new()
?
You need to construct your context with the macro added by this pull request.
On Tue, Jan 10, 2023 at 10:28 AM Qichao Lan @.***> wrote:
Hi,
I tried to run eval_float_with_context_mut("PI", &mut context) but get an Err value: VariableIdentifierNotFound("PI")'.
The same goes for eval_float_with_context_mut("f64::consts::PI", &mut context).
What's the correct way to use the consts?
— Reply to this email directly, view it on GitHub https://github.com/ISibboI/evalexpr/pull/80#issuecomment-1376895825, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASATXW6KC55AR2JJPRKVIDWRUMRXANCNFSM45ZEULKA . You are receiving this because you modified the open/close state.Message ID: @.***>
One could argue that HashMapContext::default()
should have some sane defaults, but HashMapContext::new()
should definitely create an empty context.
Hi, and thank you very much for this pull request as well.
This looks also very nice.