From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 18D9723DEC for ; Tue, 26 Mar 2024 19:26:54 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1711477614; b=FtSRTBmI04m29dJNJ8O5gZw06N0Sbzt2QUFxf6+iKpaDZd9x9rd7ruqG6E5lY14RHQlTUQRPmc DYxzySb3fcYuRyX32MiIgiJ0zSxSwpj5Kj8NlfhulmPLnCAqSgkTmQhbnJs1PjRWxFjdM58Uqi tKWDWdoR4rIVFdbEtOK5uM6zSadPkWzLvO99IowC8nXgjauIo94VZpjNpeYF/3yjdJ1QYAbFVE fI0RvyKe3QH5TIw4jGoPb5o6VOBDrCyj8eiRb0uFfJt1lwbBzV6O0N1L+IAc+D7aeVugKSD8GT Dlf1q972Uzq7IJy3L8hcaUnktjMUHEZvyQrSBHzgsAGfwg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f51.google.com) smtp.remote-ip=209.85.208.51; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1711477614; bh=v8uk1W8ZpZEdLcml9Rb6mvaUehmAgGIBXNErPmMCRw0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=srMz2qcUmSSaOZz3sJYEbGJrb40E0uvq58KoS4ISx0phQlwn1yQSjG6CtOsZunjhgIIyh3+GcX vgp45u7JudHPGMTXaDIu8GmxJpHqDIYIIj2Iq/s1Ttq/MA3AVAl6L02qMZ9bPdgHr3SJCu+s/f KEYC6jZu+5GBaqg778oGB24Tik2C4IZGn0hQ4E4E01JurjkaK09v83FlcCRgpcnQtoL461bmWd BjTMqoTG7QOmUY2qHc0IpF+w/mBHOPpVx3VB4L5YUZFiolg3gu8aWuh4edl1wasHi5StMh3zZo 3SvO2CKrvP0kD7xVpwaXWNIYajy23r6CMB0VTKK411od2A==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=aRSlpkrzzgj3nwWmagSFy8PyzgJW1mtncPvtX/H+uy8=; b=KCU2+3DQnW7APmnv0B20uU+xmb jLVwkexUO+nuVss3WGB8Z7P1mT8z8eFOiOBzVR62HNb7jEyQlmfWs95TGlavK/+OEkPpbW+PLtzLR Z0+UcU9nBzPw9nUv1MEIlbqYiKIm6iv/UwD7NQTlaRDLhc85AP1b+9hYFrPRYpzCjktEDBUP83UEa zjqXlKUVNvFB6ijVBto4R4fQ9glGp8JqQ51Z9zX7nBJ8JCIe5eUX52MJYWYlHoFBmvlHgwnsm+V7b /ItkAC2KWddvSG9mmAnlymxqGV6zagQ4woiTuS7/S2ySmENV0UELraKpXOHS8zA3pMYTQGuy5OabA VtKvD8Yg==; Received: by zero.zsh.org with local id 1rpBVd-000LFk-4Q; Tue, 26 Mar 2024 18:26:53 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f51.google.com) smtp.remote-ip=209.85.208.51; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f51.google.com ([209.85.208.51]:54735) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rpBUj-000KwH-D0; Tue, 26 Mar 2024 18:25:58 +0000 Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-56c0bd07e7bso2956439a12.1 for ; Tue, 26 Mar 2024 11:25:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1711477556; x=1712082356; darn=zsh.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=aRSlpkrzzgj3nwWmagSFy8PyzgJW1mtncPvtX/H+uy8=; b=clZNnJ+7A1PFGte6FN8QObRZvSBlQngX1eJeOcQqzw4DvnbD8UW/3odURO0Bxc/K+U 18Z6ZH/TzYK4IBvT7QdyNmjVlPZxH5+BBFeuZYXD1SFeWhiNMUDwTXJQomBetd2kjxfM dshNKRAz+Z77iUHh4aAo3fK4BZQ7iaha7Fj7wgGx1DOCLvD0ZYdFkRHF21mJRFNYfkXD 3lgrB+WUe8PIsUcO42uTQCPLlu2slfb4zglhOqEDGWnrC8jTZezy6LEWbPbVbRliCV5k tN1XvZUn+rUS2Tc45h1sY+YnEUMmb2tjHaL1beDtTJU46USSh1at288soAo71YpaOC5y 2HaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711477556; x=1712082356; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aRSlpkrzzgj3nwWmagSFy8PyzgJW1mtncPvtX/H+uy8=; b=QyLEEGSVXsl4ul02p0Xsf7R4KyK/+9DNf1VlRDOLNycoKfMN7EVrFfCTWD66g8gQgo SFh3h5GeSkAnccwAr5Bk8pbso4euiTKweiMfmxCrYuLH2DTHgeV3MrdZf5yB2f0bry37 fWOML1XAMpmMnhAoYHxVEcrHIqCny0y8568kLmhUdq/wt+/r5s7dv6oKPZoFPcOOUvxt EQF8LRiMZde7ut90ij5pF4xqQfiMZK9aP4sjtapmprheNGyVe8QWa1r2WIYRY6fsV6Oc D9RNho0vjSfY6i4dL2e/OZDJGhQkTW48rLRzXGYg76fxLdDxWjP+TkcBJSlou3Txhim4 tKYA== X-Gm-Message-State: AOJu0YwIzVt+z76+YOKGBy/vmv/52ezyy3Kp2gx99HD3K1vE05fkai99 qxEZqZyvhGkr9WyU6lsDzvwHjBpzN63WRHQM2t3ZjNzrSibA1I3WdGHYZ+RBi4bKnmsXJQjoX69 Gdxdyy1o2aHPa0GVyCxCTuss4ggl3DrylqNxCG37ay1PFp/Lv/Zwp X-Google-Smtp-Source: AGHT+IGVSiQJHnie86oxPwnrXnTlZHTbx00/7PmgTO17EAqE38TAoM7LUnOjJ6pFMwaNTFECi2OVxQ6Ew//fsbYReT8= X-Received: by 2002:a17:906:33d2:b0:a4d:bb67:6a7c with SMTP id w18-20020a17090633d200b00a4dbb676a7cmr376850eja.16.1711477556170; Tue, 26 Mar 2024 11:25:56 -0700 (PDT) MIME-Version: 1.0 References: <57374b5f-77b9-4dee-aaba-5c4bdeb1b281@zentaur.org> In-Reply-To: From: Bart Schaefer Date: Tue, 26 Mar 2024 11:25:44 -0700 Message-ID: Subject: Re: [PATCH 0/1] zsh/random module To: Clinton Bunch Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52828 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On Tue, Mar 26, 2024 at 5:47=E2=80=AFAM Clinton Bunch = wrote: > > Does this work better: > > tt(inclusive) is a flag that controls whether the result is ever equal to > tt(upper). By default it is not. If this argument is set to a non-zero > value > then it may be. Fine. > For example, if $#a is 16, you would use tt(zrand_int+LPAR()16RPAR()) > which has > 16 possible return values 0-15, in order to use it as an array index > which goes > from 1-16 you need to add one. Because the function can return zero, it > would > be an array index range error for it to also potentially return 16 > ($#a). I probably spot-checked this one incorrectly. I was looking for something = like: ... which has 16 possible return values 0-15. Because the function can re= turn zero, in order to use it as an array index from 1-16 you need to add one. = It would be an array index range error for it to also potentially return 16 (tt($#a)). > You > could, however, use the construct tt(zrand_int+LPAR()16,1,1+RPAR()) > instead of > adding 1 to achieve the same result, but it is more verbose. Sure. > Most statistics algorithms seem to also expect 0 to tt(upper)-1, so this = was > deemed the most commonly desired case and chosen as the default. Also fine.