Re: integer or float?

Ray Andrews <[email protected]> Wed, 1 Oct 2025 19:42:47 -0700
Newsgroups gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user
Message-ID <[email protected]>

On 2025-10-01 17:22, Lawrence Velázquez wrote:
> It's valid in zsh arithmetic, so it doesn't matter whether it's
> "distasteful" or "rude".  You should be formatting the output with
> printf or print -f anyway, if you care about its appearance.
>
> 	% unset -v k
> 	% k=1.
> 	% printf '%d\n' $k
> 	1
My problem arose because of an internal string test not any display 
issue.  But why the dot?  Of course zsh accepts it, but why is it output 
like that?  Perhaps simply to flag the fact that it's been forced?  I'd 
have expected it to be left off unless there really is a decimal value.  
Hardly a big deal tho, it's easy enough to live with.  I'm just 
wondering if there is a clear reason for that.

>
>