Blame test/forcenum.awk

Packit Service f629e6
BEGIN {
Packit Service f629e6
	# make some strnums
Packit Service f629e6
	nf = split("|5apple|NaN|-NaN|+NaN| 6|0x1az|011Q|027", f, "|")
Packit Service f629e6
Packit Service f629e6
	for (i = 1; i <= nf; i++) {
Packit Service f629e6
		# NaN values on some systems can come out with
Packit Service f629e6
		# a sign in front of them. So instead of using %g to
Packit Service f629e6
		# convert the strnum to a double, do it manually, and
Packit Service f629e6
		# then remove any leading sign so that the test will
Packit Service f629e6
		# work across systems.
Packit Service f629e6
		val = f[i] + 0
Packit Service f629e6
		val = val ""
Packit Service f629e6
		val = tolower(val)
Packit Service f629e6
		sub(/^[-+]/, "", val)
Packit Service f629e6
		printf "[%s] -> %s (type %s)\n", f[i], val, typeof(f[i])
Packit Service f629e6
	}
Packit Service f629e6
}