Skip to content

how to count $PARAMS? #902

Answered by lmorg
JeffMelton asked this question in Q&A
Dec 20, 2024 · 2 comments · 5 replies
Discussion options

You must be logged in to vote

@JeffMelton

I've found the issue. count is returning an int while numeric constants in expressions are num (floating point numbers).

eg

murex » %[1..3] -> count -> set num arg_count
murex » $arg_count == 3
true
murex » %[1..3] -> count -> set arg_count
murex » $arg_count == 3
false

I still consider this a bug because by default Murex is relaxed when comparing numeric types (hence why comparing an int to a str works) so it should just compare the value of those two numeric types. But it does explain why this bug hasn't been picked up before: int is rarely used since num is the default numeric data type.

I'll get a fix for this in the next release.

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@JeffMelton
Comment options

@JeffMelton
Comment options

@lmorg
Comment options

Comment options

You must be logged in to vote
2 replies
@lmorg
Comment options

@JeffMelton
Comment options

Answer selected by JeffMelton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants