bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: arithmetic operations


From: William Park
Subject: Re: arithmetic operations
Date: Wed, 25 Jan 2006 00:23:31 -0500
User-agent: Mutt/1.4.2.1i

On Tue, Jan 24, 2006 at 05:58:49PM +0300, Alexander Kshevetskiy wrote:
> Configuration Information [Automatically generated, do not change]:
> Machine: i686
> OS: linux-gnu
> Compiler: i686-pc-linux-gnu-gcc
> Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
> -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
> -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
> -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -O2 -march=athlon-xp 
> -fomit-frame-pointer
> uname output: Linux radio 2.6.14-gentoo-r2 #3 PREEMPT Wed Dec 14 22:38:58 MSK 
> 2005 i686 AMD Athlon(TM) XP 1600+ AuthenticAMD GNU/Linux
> Machine Type: i686-pc-linux-gnu
> 
> Bash Version: 3.1
> Patch Level: 5
> Release Status: release
> 
> Description:
> 
> 1)
> let a=(a+500)/1000
> does not work after update from 3.0 to 3.1, while
> let a=\(a+500\)/1000
> is working

You should quote that expression, like
    let 'a=...'

> 
> 2)
> a=8000; a=$[(a+500)/1000]; ---> 9

Shouldn't that be $((...)) ?

> a=8000; let a=\(a+500\)/1000; ---> 8
> 
> this way, we can show that 2x2=3.

-- 
William Park <opengeometry@yahoo.ca>, Toronto, Canada
ThinFlash: Linux thin-client on USB key (flash) drive
           http://home.eol.ca/~parkw/thinflash.html
BashDiff: Super Bash shell
          http://freshmeat.net/projects/bashdiff/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]