From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20613 invoked by alias); 14 May 2015 22:15:00 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35140 Received: (qmail 16865 invoked from network); 14 May 2015 22:14:56 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 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= X-Sasl-enc: qi8mp0p3adKv0FhLcKR7BlOBv4QRUGYwW/3uR81XysKr 1431641694 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: why do ceil/floor give the decimal dot? From: =?utf-8?Q?Lawrence_Vel=C3=A1zquez?= In-Reply-To: <87siay262s.fsf@debian.uxu> Date: Thu, 14 May 2015 18:14:53 -0400 Cc: zsh-workers@zsh.org Content-Transfer-Encoding: 7bit Message-Id: <14C892AF-61F9-4FEE-832C-0AD196669182@larryv.me> References: <87oalodmns.fsf@debian.uxu> <150513195617.ZM29493@torch.brasslantern.com> <87d223et0a.fsf@debian.uxu> <20150514105349.52338d94@pwslap01u.europe.root.pri> <87siay262s.fsf@debian.uxu> To: Emanuel Berg X-Mailer: Apple Mail (2.2098) On May 14, 2015, at 5:38 PM, Emanuel Berg 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