Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: $[ 09.5 ] -- bad math expression

On Sun, 2 Dec 2012, Bart Schaefer wrote:

On Dec 2, 11:30pm, Atom Smasher wrote:
}  	echo "$[ 09.5 ]"
}  	zsh: bad math expression: operator expected at `.5 '
} the problem seems to come up when using a non-integer with a leading
} zero.

Hmm. This appears to have changed back in about 2007, workers/23165. Any number with a leading zero is interpreted as an integer, unless a decimal point immediately follows the zero, in which case it's treated as floating point.

thanks! i'll give a try with the workaround, and look forward to the patch being incorporated into new builds!

i guess i can also strip the leading zero(s) from any numbers where that could be an issue...


 762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808

	"We in the West must bear in mind that the poor countries
	 are poor primarily because we have exploited them through
	 political or economic colonialism."
		-- Martin Luther King, Jr

Messages sorted by: Reverse Date, Date, Thread, Author