~vcs-imports/gawk/master

« back to all changes in this revision

Viewing changes to test/forcenum.awk

  • Committer: Arnold D. Robbins
  • Date: 2016-11-18 04:10:12 UTC
  • mfrom: (408.30.67)
  • mto: This revision was merged to the branch mainline in revision 730.
  • Revision ID: git-v1:dc7bf0cfeb2ec3eb26f1767cfe8605199613c4d6
Merge branch 'master' into feature/typed-regex-2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
BEGIN {
2
 
        # first, make some strnums
 
2
        # make some strnums
3
3
        nf = split("|5apple|+NaN| 6|0x1az|011Q|027", f, "|")
4
 
        for (i = 1; i <= nf; i++) {
5
 
                x = f[i]+0      # trigger strnum conversion to number or string
 
4
        for (i = 1; i <= nf; i++)
6
5
                printf "[%s] -> %g (type %s)\n", f[i], f[i], typeof(f[i])
7
 
        }
8
6
}