![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem in division | rochitsharma | UNIX for Dummies Questions & Answers | 9 | 11-25-2008 10:17 PM |
| display the result of wc -l with words before and after the result | melanie_pfefer | UNIX for Dummies Questions & Answers | 3 | 04-30-2008 07:33 AM |
| Outputting formatted Result log file from old 30000 lines result log<help required> | vikas.iet | Shell Programming and Scripting | 5 | 12-02-2007 10:43 PM |
| Cannot adjust division | jav_v | Filesystems, Disks and Memory | 1 | 08-20-2002 08:50 AM |
| division problem | inquirer | Shell Programming and Scripting | 3 | 04-02-2002 10:03 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
how to get exact result in my division
Hello Friends,
Why I am not getting exact result in the following division. It is rounding off automatically. Is there any way to get the exact result or can be set by user to get how many digits to carry after the decimal. Code:
gawk '{
wait_ns1 = (82290 +1 )/78 # actuall result = 1055.012821
wait_ns2 = (82320 +1 )/78 # actuall result = 1055.397436
wait_ns3 = (82350 +1 )/78 # actuall result = 1055.782051
print wait_ns1;
print wait_ns2;
print wait_ns3;
} ' my_file
Code:
1055.01 1055.4 1055.78 Or How to get the actuall result ,ie, Code:
1055.012821 1055.397436 1055.782051 |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|