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

Bug: Comparison of zero to uninitialized variable returns true, and handling of long integers #13

Open
bertysentry opened this issue Feb 2, 2018 · 4 comments

Comments

@bertysentry
Copy link
Collaborator

The below script Awk prints "wrong":

// { a = 0 ; if (a == "") { print "wrong" } else { print "right" } }

Also, integer numbers greater than 2^31 are treated as Double, and output with a pseudo-scientific notation (3.45789E+9), which is not the behavior of the "official" awk.

@bertysentry
Copy link
Collaborator Author

I will shoot another PR for this. Thanks!

@cdrasmussen
Copy link

cdrasmussen commented Feb 3, 2018 via email

@bertysentry
Copy link
Collaborator Author

Good question! ;-) What I consider as one official AWK, is GNU AWK:
https://www.gnu.org/software/gawk/manual/html_node/Strings-And-Numbers.html

But I don't want to enter a political debate over AWK :-D

@cdrasmussen
Copy link

cdrasmussen commented Feb 3, 2018 via email

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