From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 711 invoked by alias); 3 May 2015 22:41:02 -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: 35024 Received: (qmail 8257 invoked from network); 3 May 2015 22:41:00 -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,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=FAjfPwTb7uYjdkeRVlpmHnqIgrCyJlsQKdVtRzpoSkg=; b=0CyCviAFWTQSEmKP+6nVQc9r43jYAUoMDS3EqPzhk5gRR9ouacodDxans7jDQGIOT7 5SoSbiSHvEXFTV2rzY8nK5eOGRjEKelTvREBaRhRzHOY+LfZhsh1DG5QnPSAsPYsupa2 Btq/+Bn8CgY0FASjWteKn6QcR1Oexl7wJoC+S5/zrmibuxCdWBKK9k4OBngXDLgXlvd4 UZLF25ZKevM2mG0ANWUTeroKasCgylslmzBk/z9a4MZh8tZbk2aa99TJTrUVGEUS92qz 6NpufCd/rds8nd9dX8bMQOAraTOP+H/wo/5hIWrOKimXKV4O3z/shdKLgOwWGI7BBYyQ Hgaw== MIME-Version: 1.0 X-Received: by 10.43.40.130 with SMTP id tq2mr14079722icb.46.1430692856195; Sun, 03 May 2015 15:40:56 -0700 (PDT) In-Reply-To: <20150503222458.53d6d567@ntlworld.com> References: <1430685362-12270-1-git-send-email-mikachu@gmail.com> <20150503222458.53d6d567@ntlworld.com> Date: Mon, 4 May 2015 00:40:56 +0200 Message-ID: Subject: Re: PATCH: Fix two bugs in typeset_setbase From: Mikael Magnusson To: Peter Stephenson Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On Sun, May 3, 2015 at 11:24 PM, Peter Stephenson wrote: > On Sun, 3 May 2015 22:43:46 +0200 > Mikael Magnusson wrote: >> Perhaps we should apply some limit to the precision of floats? For example, >> typeset -F 100000000 foo; echo $foo >> succeeds, and at least in my setup, causes typing at the next >> commandline to be very slow, because of multiple calls to >> setunderscore(). It doesn't seem to affect zsh -f. This could also be >> a case of "don't do that then". :) > > Yes, it's not exactly a bug... but I guess it's easy to set it to some > documented ceiling where it's definitely not going to make a practical > difference. 100 or 1000? Came across this comment while poking around earlier (in params.c:convfloat()), I guess 1000 should be a very safe limit. /* * The difficulty with the buffer size is that a %f conversion * prints all digits before the decimal point: with 64 bit doubles, * that's around 310. We can't check without doing some quite * serious floating point operations we'd like to avoid. * Then we are liable to get all the digits * we asked for after the decimal point, or we should at least * bargain for it. So we just allocate 512 + digits. This * should work until somebody decides on 128-bit doubles. */ -- Mikael Magnusson