BASH scripts can do floating point math!??? NAAAWWW!!!

Have fun, guys!

Run this BASH script to see your x terminal perform serious floating point operations! HAHAH!

save as BASHYBrot do this to time it

time . BASHYBrot

BASHYBrot follows:

#!/bin/bash

S0=B; S1=A; S2=S; S3=H; S4=Y; b=bc; I=-1

for x in {1..24} do R=-2 for y in {1..80} do B=0; r=0; i=0 while [ $B -le 32 ] do r2=$(echo "$r*$r" | $b) i2=$(echo "$i*$i" | $b) i=$(echo "2*$i*$r+$I" | $b) r=$(echo "$r2-$i2+$R" | $b) ((B+=1)) V=$(echo "($r2 +$i2)>4" | $b) if [ "$V" -eq 1 ]; then break fi done if [ $B -ge 32 ]; then echo -n " "; else U=$(((B*4) / 15+30)) echo -en "\E[01;$U""m" C=$((C%5)) eval "echo -ne \$E\$S$C" ((C+=1)) fi R=$(echo "$R+0.03125" | $b) done echo -e "\E[m\E(\r" I=$(echo "$I+0.08333" | $b) done

Reply to
DecadentLinuxUserNumeroUno
Loading thread data ...

FFS, man bc.

Grant.

Reply to
Grant

NOT! sudo `rm which bc`

--
umop apisdn
Reply to
Jasen Betts

On Tue, 02 Dec 2014 15:25:36 +1100, Grant Gave us:

Naw, man... there's no fast fourier stuff in there! :-)

Yes... I know what it is. I was born 'before cells'.

Reply to
DecadentLinuxUserNumeroUno

On 2 Dec 2014 05:45:28 GMT, Jasen Betts Gave us:

SH SH SHHHH SHHHH SHHHHHH

BASH you upside yer dwnhaed.

Reply to
DecadentLinuxUserNumeroUno

pure insanity

Mark

Reply to
Mac Decman

On Wed, 03 Dec 2014 11:59:18 -0800, Mac Decman Gave us:

Yours?

Reply to
DecadentLinuxUserNumeroUno

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.