title: awk float point representation
body: <p>Hey I am new to shell script and I am trying to write something involving float point calculation. I intended to use either bc or awk.</p>
  
  <p>However, since I cannot find a way to tell bc do x^(1/3) correctly, I ended up with awk. I get everything done except for one problem: for doing division with awk, whenever my dividend is smaller than 1, say, 0.0064, awk seems to read it as 0. Therefore I got inf as the result. I am not sure where I did wrong.</p>
  
  <p>Here is my code, I need to store the calculated value into variables, not necessarily to print them out.</p>
  
  <p>And I am also curious about how are values treated by bc, awk or simple expres'' form? Are they read/stored as numerical value or strings? </p>
  
  <p>In addition, just to use awk as a calculate, can I do x=$(echo "expression" | awk) or something similar, without using print expression in awk '{ }'?</p>
  
  <pre><code>#!/bin/bash
  
  
  # molar concentration = 0.1 mM per nm^3
  MOLAR=0.0001
  NA=6.02*10^23
  CONV=1*10^24
  
  number_concentration=$(echo "scale=10;$MOLAR * $NA / ($CONV)" | bc)
  echo $number_concentration
  
  # determine box size
  volume=$(awk 'BEGIN {print 1+$number_concentration}' /dev/null)
  echo $volume
  
  # length
  a=$(echo awk 'BEGIN {$volume^(1/3)}' /dev/null)
  </code></pre>