zsh-workers
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-workers@zsh.org
Subject: Re: Math expression evaluation error?
Date: Sat, 10 Jan 2015 14:21:32 -0800	[thread overview]
Message-ID: <54B1A5EC.2080202@eastlink.ca> (raw)
In-Reply-To: <150110111445.ZM21328@torch.brasslantern.com>

On 01/10/2015 11:14 AM, Bart Schaefer wrote:
> On Jan 10, 10:48am, Ray Andrews wrote:
> }
> } is just to ask: What is most useful?  What would produce the maximum
> } utility along with the least surprise, especially for a new user? In
> } which direction is 'the future'?
>
> Call me a cynic or a curmudgeon as you prefer, but the future of new
> users who would give so little thought and study to the tools they
> are using as to find this a problem more than once, is to not use
> shells at all.

That's quite legitimate.  The 'fix' is after all very simple.  You know, in
this sort of discussion pressures can build beyond what the issue
merits.  'setopt force_float' and there's nothing more to worry about.
But so long as you wish to discuss it, I'll just do what I do and advocate
for a friendlier and more intuitive shell where possible:  However simple
the fix may be, it remains my view that the intuitive behavior should
be the default.  It's just my paradigm.  I quite understand that it will
not prevail. Not worth the price of a beer, and certainly not worth any
disturbance.
>
> It *is* probably less than ideal that "zcalc -f" is not the default

And that's all I'm saying, (but, for "$ (( ))" too).

BTW, just Googling, I see that this issue has come up time and again.
Our original poster on this thread is not the first person to be got by
this gotcha.  Why not make the issue go away, once and for all?

One could have fun with some facetious advertising:
"Try zsh, the shell where 1/2 + 1/2 = 1 !!!"

> for the actual calculator utility; but pretending that $(( ... )) could
> ever be described "a calculator with no surprises or gotchas" regardless
> of integer arithmetic, is misleading because it isn't a calculator and
> trying to think of it that way is going to cause surprises and gotchas.

Well, it could come to a question of terminology or even of hard facts.  I
myself have (until this issue came up) never done anything beyond simple
integer addition and subtraction. From what I read, $ (( )) does quite
sophisticated calculations and it is ergo, ipso facto a calculator. And 
I also
presume that it accesses all the power of 'zcalc' (because why 
*wouldn't* it?)

However, if it does have gotchas in it (I mean beyond the current subject)
I can't say, I just presume it does what it advertises itself to do, and
my experiments with it bare that out-- and that's 'calculation' as I use
the word. But don't  take my pseudo manual as anything more than a
comment please it's just what I wish was the case.




  reply	other threads:[~2015-01-10 22:21 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-09 19:46 jdh
2015-01-09 20:15 ` Peter Stephenson
2015-01-09 21:40   ` jdh
2015-01-09 22:19     ` Ray Andrews
2015-01-09 23:06       ` Lawrence Velázquez
2015-01-09 23:52         ` Ray Andrews
2015-01-10  0:25           ` Bart Schaefer
2015-01-10  7:27             ` Ray Andrews
2015-01-10 16:53               ` Bart Schaefer
2015-01-10 18:48                 ` Ray Andrews
2015-01-10 19:14                   ` Bart Schaefer
2015-01-10 22:21                     ` Ray Andrews [this message]
2015-01-11  1:51                       ` Bart Schaefer
2015-01-11  5:10                         ` Ray Andrews
2015-01-12  9:17                           ` Vincent Lefevre
2015-01-12 16:18                             ` ZyX
2015-01-13 16:00                               ` Vincent Lefevre
2015-01-13 23:03                                 ` ZyX
2015-01-14 14:47                                   ` Vincent Lefevre
2015-01-14 21:37                                     ` ZyX
2015-01-15 13:34                                       ` Vincent Lefevre
2015-01-15 13:41                                         ` Vincent Lefevre
2015-01-15 18:32                                         ` ZyX
2015-01-15 21:57                                           ` Bart Schaefer
2015-01-09 22:40     ` Peter Stephenson
2015-01-12 10:55       ` Peter Stephenson
2015-01-14 15:02       ` Vincent Lefevre
2015-01-14 15:38         ` Peter Stephenson
2015-01-15 14:58           ` Peter Stephenson

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=54B1A5EC.2080202@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-workers@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).