Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: why do ceil/floor give the decimal dot?
- X-seq: zsh-workers 35140
- From: Lawrence Velázquez <vq@xxxxxxxxx>
- To: Emanuel Berg <embe8573@xxxxxxxxxxxxx>
- Subject: Re: why do ceil/floor give the decimal dot?
- Date: Thu, 14 May 2015 18:14:53 -0400
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=larryv.me; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=ow/1GI05NYxa99nhM+8GWjfI2KY=; b=CQEHvJ YTR+Pn+t+iK70Lazm5hb9gx/ugByH/4SiCtULMZEB6NOqgUe+0mTe5YWu9RPjJhR YiMUQ0ssIDbuR4wF63q86iwfUJiygtzXl1CGTmeTJDh63Yp17N0ZIDRiH0p693v7 UEmD1814ytB6CaYFB00h9tV29v3AY170vBun4=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=ow/1GI05NYxa99n hM+8GWjfI2KY=; b=C87E129XucUW+jQMD4QJkRUE+6oJ0YYsSEt/6zjlCB3WZEh StT1B9HvT7cFd2sGeKQn7aGfTdfhJWsB39dbu8S6Mt5UnYhpdgpkvtVmqwX0LqR4 fN2HXbAWXo1IIrXrC5YYviLRCoMn4QsuUktrQKy6iMiCkqRKrwrBm0J7IG/4=
- In-reply-to: <87siay262s.fsf@debian.uxu>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <87oalodmns.fsf@debian.uxu> <150513195617.ZM29493@torch.brasslantern.com> <87d223et0a.fsf@debian.uxu> <B6914C0C-15CA-4FE2-A21A-4320D4CD4927@larryv.me> <20150514105349.52338d94@pwslap01u.europe.root.pri> <87siay262s.fsf@debian.uxu>
On May 14, 2015, at 5:38 PM, Emanuel Berg <embe8573@xxxxxxxxxxxxx> wrote:
> I like the solution better to have the types all
> floats (or whatever) and then use printf to make it
> look the way you want.
You should use %g then (with appropriate precision) because %d does an
implicit conversion.
% printf '%d\n' $(( 1e20 ))
-9223372036854775808
% printf '%g\n' $(( 1e20 ))
1e+20
% printf '%.30g\n' $(( 1e20 ))
100000000000000000000
vq
Messages sorted by:
Reverse Date,
Date,
Thread,
Author