Blame test/forcenum.awk

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