why dividing integers result becomes float ? #1687
Answered
by
mikefarah
shakibamoshiri
asked this question in
Q&A
-
is this result valid, should not be integer ? yq -n '.result=(200 / 10)'
result: !!float 20 I was expecting yq -n '.result=(200 / 10)'
result: 20 version yq --version
yq (https://github.com/mikefarah/yq/) version v4.34.1 |
Beta Was this translation helpful? Give feedback.
Answered by
mikefarah
Jun 5, 2023
Replies: 1 comment 1 reply
-
Yeah I think you're right - the divide is a little naive and just assumes a float. Feel free to raise a bug. As a workaround you can manually override the tag to be an int:
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
shakibamoshiri
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah I think you're right - the divide is a little naive and just assumes a float. Feel free to raise a bug.
As a workaround you can manually override the tag to be an int: