Proc bash pouziva cela cisla pri deleni?
pavel hampl
hampl na gncz.cz
Pondělí Prosinec 31 13:54:29 CET 2001
Zdenek Svarc wrote:
>
> Kdyz necham "let promena=1/2", vrati se mi hodnota promene 0, ale ja spravne chci 0,5. Pritom bash umi pracovat i s desetinym cisly. Kde je problem, jak prinutit bash, aby mi vracel presny vysledek? Dik za stupidni odpoved na stupidni otazku :-)
>
> Zd
>
Vypis z "man bash":
ARITHMETIC EVALUATION
The shell allows arithmetic expressions to be
evaluated, under certain
circumstances (see the let builtin command and
Arithmetic
Expansion). Evaluation is done in long integers with
no check for
^^^^^^^^^^^^^^^^^^
overflow, though division by 0 is trapped and flagged
as an error.
PHampl
--
------------------------------------------
Pavel Hampl email: hampl na gncz.cz
GN Resources CZ http://www.gncz.cz
Ve Smeckach 20 tel: +420-2-22101821
11000 Praha 1, CZ
Další informace o konferenci Linux