Hi I'm not using Korn93 but want to use floating point variable.
Is there any solution to do that ?
thx for help.
---------- Post updated at 02:28 PM ---------- Previous update was at 12:38 PM ----------
I have the following peace of code:
for n in `cat log.January.1.array`
do
(( number=`print $n | awk -F\; '{print $1}'` ))
(( filesSize=$filesSize+$number ))
done
print "Files size equals : $filesSize"
(( nrOfIterations=$filesSize/200000 ))
print "Estimated iterations number is: $nrOfIterations"
if (( nrOfIterations>0 ));
then
(( nrOfIterations=$nrOfIterations+1 ))
print "Real iterations number is: $nrOfIterations"
print
fi
Problem is how to distinguish value round this value to sections : ?
1.1-1.5 this should be equal to 1
1.6-1.9 this should be equal to 2
thx for help
---------- Post updated at 02:53 PM ---------- Previous update was at 02:28 PM ----------
I solved it.
Solution below :
for n in `cat log.January.1.array`
do
(( number=`print $n | awk -F\; '{print $1}'` ))
(( filesSize=$filesSize+$number ))
done
print "Files size equals : $filesSize"
(( nrOfIterations=$filesSize/200000 ))
print "Estimated iterations number is: $nrOfIterations"
if (( nrOfIterations=0 ));
then
(( nrOfIterations=$nrOfIterations+1 ))
print "Real iterations number is: $nrOfIterations"
print
else
(( nrOfIterations=$nrOfIterations+1 ))
print "Real iterations number is: $nrOfIterations"
print
fi