zsh-users
 help / color / mirror / code / Atom feed
From: "Lawrence Velázquez" <vq@larryv.me>
To: Ray Andrews <rayandrews@eastlink.ca>
Cc: zsh-users@zsh.org
Subject: Re: arithmetic anomaly
Date: Fri, 26 Mar 2021 17:59:42 -0400	[thread overview]
Message-ID: <134FF043-EB7D-4E37-A8F3-1A29916C08CD@larryv.me> (raw)
In-Reply-To: <3e7f2094-9da9-315f-ae08-a6b5cf3eadf6@eastlink.ca>

> On Mar 26, 2021, at 5:45 PM, Ray Andrews <rayandrews@eastlink.ca> wrote:
> 
> On 2021-03-26 10:09 a.m., Lawrence Velázquez wrote:
>> 
>>     printf '%s %.0f\n' 'zsh (%.0f):' '22.0**22'
>> 
> Interesting I was formatting with the same ' %.0f ' but getting  the ca. 200 character output.  ' %s ' is no improvement.

22^22 is not 200 digits long. We're not talking about the same
input.

% cat /tmp/demo.zsh
python3.9 <<\EOF
print(f"{'Python:':<11} {100**100}")
EOF

printf '%-10s %s\n' 'zsh (%s):' $(( 100.0**100 ))

printf '%s %.0f\n' 'zsh (%.0f):' '100.0**100'
% zsh /tmp/demo.zsh
Python:     100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
zsh (%s):  9.9999999999999997e+199
zsh (%.0f): 99999999999999996973312221251036165947450327545502362648241750950346848435554075534196338404706251868027512415973882408182135734368278484639385041047239877871023591066789981811181813306167128854888448


> How do I get her to trim it down?

*it

vq


      reply	other threads:[~2021-03-26 22:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25 15:52 Ray Andrews
2021-03-25 20:40 ` Lawrence Velázquez
2021-03-25 22:44   ` Ray Andrews
2021-03-25 22:54     ` Roman Perepelitsa
2021-03-25 23:57       ` Ray Andrews
2021-03-26  0:16 ` Oliver Kiddle
2021-03-26  0:37   ` Ray Andrews
2021-03-26 10:35     ` Roman Perepelitsa
2021-03-26 14:36       ` Ray Andrews
2021-03-26 14:49         ` Roman Perepelitsa
2021-03-26 15:35           ` Ray Andrews
2021-03-26 17:09             ` Lawrence Velázquez
2021-03-26 21:45               ` Ray Andrews
2021-03-26 21:59                 ` Lawrence Velázquez [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=134FF043-EB7D-4E37-A8F3-1A29916C08CD@larryv.me \
    --to=vq@larryv.me \
    --cc=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).