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

hist[val] value #1

Open
dkrikun opened this issue Feb 18, 2019 · 2 comments
Open

hist[val] value #1

dkrikun opened this issue Feb 18, 2019 · 2 comments

Comments

@dkrikun
Copy link

dkrikun commented Feb 18, 2019

hist[val] {

Hi, I think you need to test hist[val] == 2 because it will be trivially set to 1
on each line... at least this is what my awk thinks!

@phikal
Copy link
Owner

phikal commented Feb 20, 2019

Honestly, I don't even remember what I was thinking, but...

  1. I am certain that it worked, since the result passed
  2. hist[val] == 2 is always false, since hist[val] is only set to 1.

@dkrikun
Copy link
Author

dkrikun commented Feb 20, 2019

You're right 2 doesn't make sense..
I see I have hist[val] += 1 instead of hist[val] = 1, this is why it works with 2 for me.

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