One simple way to do simple floating point arithmetics in shell

#!/bin/tcsh
set n = 128
set beta = `echo "(-0.6)*($n)*($n)" | bc -l`
set ppn = 16
set np = 31
set nodes = `echo "if ($np%$ppn==0) {$np/$ppn;} else {$np/$ppn+1}" | bc`

Advertisements

0 Responses to “One simple way to do simple floating point arithmetics in shell”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Categories

Blog Stats

  • 247,883 hits

%d bloggers like this: