[MEncoder-users] Bits per block

Ivo ivop at euronet.nl
Fri Jul 13 21:42:31 CEST 2007


On Friday 13 July 2007 19:09, Moritz Barsnick wrote:
> On Thu, Jul 12, 2007 at 15:33:51 +0200, Federico Zema wrote:
> > echo $(($((900*1000))/$((25*$((640*480))/$((16*16))))))
> > 30
>
> Bash may be able to calculate, but it's just not the right tool. :)
>
> 'bc' should be available on all Unices:
> user at host:~ > echo '((900*1000)/(25*(640*480)/(16*16)))' | bc # caution,
> no precision! 30
> user at host:~ > echo '((900*1000)/(25*(640*480)/(16*16)))' | bc -l
> 30.00000000000000000000

You say 'should be', but I ran into a system not so long ago that did not 
have bc installed. When it's just multiplications and divisions, I use 
expr.

$ expr \( \( 900 \* 1000 \) / \( 25 \* \( 640 \* 480 \) / \( 16 \* 16 \) \) 
\)
30

That's as portable as it gets IMHO.

--Ivo



More information about the MEncoder-users mailing list