Portál AbcLinuxu, 13. května 2025 16:36
echo 'scale=2; 2.3333*5.55' | bc 12.9498 bc -v bc 1.06.94Rad bych mel vysledek z bc jen se dvemi desetinymi misty. Definice scale ve vyse zminenem prikladu nereaguje (pokud tomu dobre rozumim). Kde delam chybu?
echo 'scale=2; 5/4' | bc 1.25
echo '2.3333*5.55' | bc | xargs printf "%.2f"
Unless specifically mentioned the scale of the result is the maximum scale of the expressions involved.
expr * expr
The result of the expression is the product of the two expressions.
expr / expr
The result of the expression is the quotient of the two expressions.
The scale of the result is the value of the variable scale.
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.