1838175 Members
3369 Online
110124 Solutions
New Discussion

let command

 
suryanarayana_1
Occasional Advisor

let command

Hi,

How I will get fractional values by using "let" command.
Thanks in advance
Surya.
2 REPLIES 2
A. Clay Stephenson
Acclaimed Contributor

Re: let command

You can't. The shell ONLY does integer math. You will need to use bc, awk, or Perl.
If it ain't broke, I can fix that.
curt larson_1
Honored Contributor

Re: let command

or use a different shell

#!/usr/dt/bin/dtksh

typeset -F abc #for a floating point variable
x=5
y=20
abc=$(( x/y ))
print $abc