zsh-workers
 help / color / mirror / code / Atom feed
* Math expressions with 08 or 09 -> zsh2.6-beta10
@ 1995-08-30 13:50 Paul H. Becker
  1995-08-30 14:27 ` Matt
  0 siblings, 1 reply; 2+ messages in thread
From: Paul H. Becker @ 1995-08-30 13:50 UTC (permalink / raw)
  To: zsh-workers


These leading zeros are inconsistent.  Math expressions do not seem to
like numbers 08 or 09.

    zsh -f
    % [ 03 -gt 07 ] && echo ok
    % [ 07 -gt 03 ] && echo ok
    ok
    % [ 07 -gt 07 ] && echo ok
    % [ 08 -gt 07 ] && echo ok
    zsh: bad math expression: unbalanced stack
    % [ 07 -gt 08 ] && echo ok
    zsh: bad math expression: unbalanced stack
    % [ 07 -gt 09 ] && echo ok
    zsh: bad math expression: unbalanced stack

in an effort to stip off the leading zero....

    % let x=01
    % echo $x
    1
    % let x=07
    % echo $x
    7
    % let x=08
    zsh: lvalue required
    % echo $x
    7
    % echo $ZSH_VERSION
    2.6-beta10


(thanks for your work on the best shell out there...)
------------------------------------------------------------------------------
Paul Becker              o       Atria Software       main:    508-650-5100
(508)650-5116           /~>     24 Prime Park Way     fax:     508-647-1760
becker@Atria.com     o...(\     Natick, MA  01760  <URL://http:/www.atria.com/>
-----------------  ~~~~~~~~~~  -----------------------------------------------

New ! Effective September 5, 1995
------------------------------------------------------------------------------
Paul Becker              o       Atria Software       main:    617-676-2400
(617)676-2605           /~>     20 Maguire Road       fax:     617-676-2410
becker@Atria.com     o...(\     Lexington, MA  02173  http://www.atria.com/
-----------------  ~~~~~~~~~~  -----------------------------------------------


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Math expressions with 08 or 09 -> zsh2.6-beta10
  1995-08-30 13:50 Math expressions with 08 or 09 -> zsh2.6-beta10 Paul H. Becker
@ 1995-08-30 14:27 ` Matt
  0 siblings, 0 replies; 2+ messages in thread
From: Matt @ 1995-08-30 14:27 UTC (permalink / raw)
  To: becker; +Cc: zsh-workers

> These leading zeros are inconsistent.  Math expressions do not seem to
> like numbers 08 or 09.

i dont know if this actually applies to this instances but ...

just a guess but isnt any number with a leading zero treated as an octal 
number(base 8)?

> 
>     zsh -f
>     % [ 03 -gt 07 ] && echo ok
>     % [ 07 -gt 03 ] && echo ok
>     ok
>     % [ 07 -gt 07 ] && echo ok
>     % [ 08 -gt 07 ] && echo ok
>     zsh: bad math expression: unbalanced stack

in this case the number '08' will be unrecognised...

>     % [ 07 -gt 08 ] && echo ok
>     zsh: bad math expression: unbalanced stack

in this case the number '08' will be unrecognised...


>     % [ 07 -gt 09 ] && echo ok
>     zsh: bad math expression: unbalanced stack

in this case the number '09' will be unrecognised...

> 
> in an effort to stip off the leading zero....
> 
>     % let x=01
>     % echo $x
>     1
>     % let x=07
>     % echo $x
>     7
>     % let x=08
>     zsh: lvalue required

in this case the number '08' will be unrecognised...

>     % echo $x
>     7

dont know about this - but it seems to be regressing to the last 
officially 'valid' set value.... ie '07'

>     % echo $ZSH_VERSION
>     2.6-beta10
> 

now i dont know if what i described is the supposed behaviour or not ...

dont grill me if i am wrong please ....... [my mail box is only so big..!]

matt.


Thought for the Day: Darth Vader sleeps with a Teddywookie.
__________________________________________________________________________
Prism Technologies Ltd.,    |                 Matt
KingFisher House, Kingsway, |  Tel No.    +44 (0)191 491 3983
Team Valley, Gateshead,     |  Fax No.    +44 (0)191 491 3973          
Tyne & Wear,                |  EMail.     mc@prismtech.co.uk
NE11  0JQ, U.K.             |  WWW Page   http://www.prismtech.co.uk/
__________________________________________________________________________


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1995-08-30 14:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-08-30 13:50 Math expressions with 08 or 09 -> zsh2.6-beta10 Paul H. Becker
1995-08-30 14:27 ` Matt

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).