From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,PDS_BTC_ID,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16467 invoked from network); 26 Mar 2021 17:10:02 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 26 Mar 2021 17:10:02 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1616778602; b=gkUzXBSiAO7iWaGRXncF5LjIwuHqpIpi815br84n4jtOzNGQj+XwYE+5tiFwS07ZWHOEihbKKF MMoeLifXCnFWB2cu5tiZxOQHhh3c0J1SAkWXyu3ifHTZXOi3Qcly29OvSxeJ92kx6Vd5AGSe52 YhhvR3nKbqILpIatfefVPEP94DZp6LoOGKfILXj6wFgE3QN14VDE1kn302FFi0Qky+95+P4vku riHCHk4Bm/fWxf2FqWCaHH4/58tjd//fvhBXcqlms/SjgxIcQWs6/tk1uaHq2DcyHx/aqfxtrz 3Ocq3kFgLdgcC2HS/ZV4L1nIlbnGFNzOqafCF3Cc3ZMOKQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (wout4-smtp.messagingengine.com) smtp.remote-ip=64.147.123.20; dkim=pass header.d=larryv.me header.s=fm3 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm2 header.a=rsa-sha256; dmarc=pass header.from=larryv.me; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1616778602; bh=wyXGg5uZ+lKySTnj1I4cSjV4s3GbC0OHaAksrDw8K4Y=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:To:References:Message-ID:Content-Transfer-Encoding:Cc:Date: In-Reply-To:From:Subject:MIME-Version:Content-Type:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=UuPqntlGYlPIanqdhlqSOzE8Rz86T8oPs1HoUpddqa3o9TyVN287MXDPnT727585G53S9skW0S HYsKgH/JnDGstDFhmcUSIQ9+/djFCKkXpu+hs102x3dcl584hJixXuhC18ffCnAdZGEsy2CtPd EEpJHSMy68OHAmMTCw0mHKIVzKvntr6v4zxeKlaEL4GGhUERQNFTxaN9Ljh+gCDP50mvZGEv7r HVflJqODh6sLJpUjFwClb1eZGmWYoAHgpohObN1Aav4UPPKYsMgyd5r53sAIqO6VAPyJMUDdS4 5a+WyqmFF5Ck57h+RzbiaehGJCu6u35De6TiDAtKEKPIdw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:To:References:Message-Id: Content-Transfer-Encoding:Cc:Date:In-Reply-To:From:Subject:Mime-Version: Content-Type:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=C6pt2A/8ezuzM5n2nDtnzY+C+ZBnDDNWVJDaaI9oP3A=; b=Qr158xaS/1ZtbVApwwmj/bAGW7 g5w+sEDPqQudS8QUKVmiiPpSbXCrNAFnVpgds0TOJxm7XnBSfYoNWa+Ql13L/auW05uKWEiM9W2c1 ZVjcC4An/dN7UWMrMv0+f8MtAjdUcnpwG4WrXirnxf49exRLh4T1er2XCTnQnXFhve82OcEugxwOR zh/4hoxpqR+dVtbBQOOkT2NJwhnGK2dFPqbVURpsZW1qzZI7NCbQRnoJQjj/qsUQpNX5kelI6FNau 4wsu5aaFDMJsYVRL25kid4zxY7kcfB6w2v2oADqtRlsWT2tHZu3Hn48ie/lwGrvq/evb8TWs83zxF bpiyEDMA==; Received: from authenticated user by zero.zsh.org with local id 1lPpyC-000IEO-6T; Fri, 26 Mar 2021 17:10:00 +0000 Authentication-Results: zsh.org; iprev=pass (wout4-smtp.messagingengine.com) smtp.remote-ip=64.147.123.20; dkim=pass header.d=larryv.me header.s=fm3 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm2 header.a=rsa-sha256; dmarc=pass header.from=larryv.me; arc=none Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:42291) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1lPpxc-000H2p-Lf; Fri, 26 Mar 2021 17:09:27 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 213821EA2; Fri, 26 Mar 2021 13:09:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 26 Mar 2021 13:09:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=larryv.me; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm3; bh=C 6pt2A/8ezuzM5n2nDtnzY+C+ZBnDDNWVJDaaI9oP3A=; b=QScvIkELxbbAiMg1d E5pfemgrMR/G95IPlI5j5tbKNbMqxti06c7sE4ySe1TvECChJpSlb8IrXAgYnTn/ J6LfA7JB5u7flY7nPC+wo1pl0BqCrfvjx5xw4vScRyIm0nag5wsr01Is//0ApP3k JTTz4HBx82XZNfi68wRRPweASmvcA5EkPlkD8mYXPsleCvedPUO6cNZ+cFPW3hFC hfdzPpYVCCU1cQQh7Yy9wStq5/hAi5K5xQo+T2JbLVj6uahGxA2Uu6sLiMK9UFmg R4bkjlAB9TpbyRDi74D2geqolLexXIrErm/pzsUTtjnP+QUKX7cl7p+euHKNDx9V JbyAw== DKIM-Signature: v=1; a=rsa-sha256; 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-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=C6pt2A/8ezuzM5n2nDtnzY+C+ZBnDDNWVJDaaI9oP 3A=; b=hW3MrmrRjPju/bmCE1qJkwDJ9klzRzaLEagMNcU11vfMcHvvTcgNeCGfK LXn917EbmgNkfpqrWDKGZSWSrqeDgnw6OEKo+Q/KvyT1Z8HlYfkhoAFf7ziCm06k 10twq/oeCuyaUfXatURpjwPMgXj2ZGzclhKyA7Ei5Q00OIyeHv8+QnhWMVGCghnz qR0l1/sW9FR4P4ubZoihuR50/SNHUJgYALTJxRViGQRfVHHyZ/WcUvt3DTOvCdzk 07akhEHHImkjPnu26Wo89pavPhPuyDyH4bM4p1h3DpmaRwNK0DAQqiKJLPZ2tzIk hP2XN2q/Y8HrVRUBvo2oX7/xdUF6g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudehvddgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptggguffhjgffgffkfhfvofesthejmhdthhdtvdenucfhrhhomhepnfgrfihr vghntggvpgggvghljoiiqhhuvgiiuceovhhqsehlrghrrhihvhdrmhgvqeenucggtffrrg htthgvrhhnpefgffefveevueehvefhieduheffhfdtleeiieduueduleeiuedtjeehgfeg vefhffenucffohhmrghinhepghgrrhgsrghgvgdrtggrthenucfkphepjedvrdekledrle egrdeftdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pehvqheslhgrrhhrhihvrdhmvg X-ME-Proxy: Received: from [192.168.1.15] (pool-72-89-94-30.nycmny.fios.verizon.net [72.89.94.30]) by mail.messagingengine.com (Postfix) with ESMTPA id 2F73B240054; Fri, 26 Mar 2021 13:09:21 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: arithmetic anomaly From: =?utf-8?Q?Lawrence_Vel=C3=A1zquez?= In-Reply-To: <691e63e8-aff6-cce6-d7b4-7bf6de10363a@eastlink.ca> Date: Fri, 26 Mar 2021 13:09:19 -0400 Cc: zsh-users@zsh.org Content-Transfer-Encoding: 7bit Message-Id: <254ED248-857D-460C-98B4-EFDF074CD6F8@larryv.me> References: <0227b30d-4f09-2c8b-1248-557859d875ce@eastlink.ca> <91303-1616717760.288585@Iyj2.F9RA.VD0P> <6d70bc8d-73d3-7866-6485-ee89dafdebc9@eastlink.ca> <691e63e8-aff6-cce6-d7b4-7bf6de10363a@eastlink.ca> To: Ray Andrews X-Mailer: Apple Mail (2.3445.104.17) X-Seq: 26612 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: > On Mar 25, 2021, at 7:57 PM, Ray Andrews wrote: > > That's for sure. I'd rather the result was truncated. Why show > garbage? > On Mar 25, 2021, at 8:37 PM, Ray Andrews wrote: > > But why do we let them spew out garbage? Just now I experimented > with " %d " as the output specifier and it very politely goes > obviously wrong at level 16 so you know it's reached the end of its > rope, but the floats just keep on floating way into nonsense. > On Mar 26, 2021, at 10:36 AM, Ray Andrews wrote: > > I'm asking why the 'Level: 100' result isn't just aborted after 15 > digits given that all the rest is garbage? > On Mar 26, 2021, at 11:35 AM, Ray Andrews wrote: > > surely in my case it's simply a plain fact that no decimal past 15 > can be accurate ever? zsh already knows how to indicate an appropriate degree of precision. You are FORCING it to spew garbage. % cat /tmp/demo.zsh; echo python3.9 <<\EOF print(f"{'Python:':<11} {22**22}") EOF printf '%-10s %s\n' 'zsh (%s):' $(( 22.0**22 )) printf '%s %.0f\n' 'zsh (%.0f):' '22.0**22' % zsh /tmp/demo.zsh Python: 341427877364219557396646723584 zsh (%s): 3.4142787736421956e+29 zsh (%.0f): 341427877364219559508793360384 vq