Sponsored Content
Top Forums Shell Programming and Scripting Problem with float calculation and awk Post 302189073 by jisha on Friday 25th of April 2008 02:06:14 AM
Old 04-25-2008
Thank you so much for ur time ..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Integer/Float Script Problem

Hi, I have a script which takes a value from a file and performs calculations on it. Trouble is that this value is a float not an integer and it errors at the decimal point! eg. 94.62 I would like to be able to detect the length of the float (in this above case, 5 characters), and simply do a... (2 Replies)
Discussion started by: danhodges99
2 Replies

2. Programming

math.h: float ceilf(float x)

Good morning, I'm testing the use of ceilf: /*Filename: str.c*/ #include <stdio.h> #include <math.h> int main (void) { float ceilf(float x); int dev=3, result=0; float tmp = 3.444f; printf("Result: %f\n",ceilf(tmp)); return 0; } (1 Reply)
Discussion started by: jonas.gabriel
1 Replies

3. Shell Programming and Scripting

awk calculation problem

I have a list of coordinate data, sampled below. 54555209 784672723 I want it as: 545552.09 7846727.23 Below is my script: BEGIN {FS= " "; OFS= ","} {print $1*.01,$2*.01} This is my outcome: 5.5e7 7.8e8 How do I tell awk that I want to keep all the digits instead of outputting... (1 Reply)
Discussion started by: ndnkyd
1 Replies

4. Shell Programming and Scripting

How to format the output using float in awk{printf}

Hi I'm using awk to manipulate the data in the 6th field of the file xxx_yyy.hrv. The sample data that is available in this field is given below 220731.7100000000000000 When i tried using this command cat xxx_yyy.hrv | awk '{printf("%23.16f\n",$6*-1)}' I get the output as... (4 Replies)
Discussion started by: angelarosh
4 Replies

5. Shell Programming and Scripting

Float number format problem -Awk

Here is the script I'm using awk '{print $1,"\t",(($2+$3)/2)-x,"\t",(($2+$3)/2)+x,"\t",$4,"\t",$5}' x=500 $1 I just want to make float numbers (red) like normal numbers (green) output cX 1.65107e+08 1.65108e+08 13 64.2 cX 165112764 165113764 27 ... (7 Replies)
Discussion started by: ruby_sgp
7 Replies

6. Shell Programming and Scripting

Problem in echo value after some calculation

val=21 total=3250 echo "`echo "scale=2; $val*100/$total" | bc`" Output: .64 How do i show the output become "0.64" instead of ".64" ?? Someone can help? (1 Reply)
Discussion started by: alvin0618
1 Replies

7. Shell Programming and Scripting

Awk or If/statement Calculation Problem

#!/bin/sh CURRENTSTATE=2 CSVCSTATE=2 LASTSTATECHANGE=8 CSVCSTATEAGE=5 if (($CURRENTSTATE==$CSVCSTATE))&&(($LASTSTATECHANGE>=$CSVCSTATEAGE)) echo GREAT fi returns: ./aff: line 12: syntax error near unexpected token `fi' ./aff: line 12: `fi' what am i doing wrong here? (6 Replies)
Discussion started by: SkySmart
6 Replies

8. Shell Programming and Scripting

printf (awk,perl,shell) float rounding issue

Hi guys, could someone throw some light on the following behaviour of printf (I'll start with info about the system and the tool/shell/interpreter versions)?: $ uname -a Linux linux-86if.site 3.1.0-1.2-desktop #1 SMP PREEMPT Thu Nov 3 14:45:45 UTC 2011 (187dde0) x86_64 x86_64 x86_64... (9 Replies)
Discussion started by: elixir_sinari
9 Replies

9. Shell Programming and Scripting

[awk] rounding a float number?

Heyas Trying to calculate the total size of a file by reading its bitrate. Code snippet: fs_expected() { # # Returns the expected filesize in bytes # pr_str() { ff=$(cat $TMP.info) d="${ff#*bitrate: }" echo "${d%%,*}" | $AWK '{print $1}' | head -n 1 } t_BYTERATE=$((... (9 Replies)
Discussion started by: sea
9 Replies

10. Shell Programming and Scripting

awk split and awk calculation in the same command

I am trying to run the awk below. My question is when I split the input, then run anotherawk to perform a calculation using that splitas the input there are no issues. When I try to combine them the output is not correct, is the split not working or did I do it wrong? Thank you :). input ... (8 Replies)
Discussion started by: cmccabe
8 Replies
wxGraphicsMatrix(3erl)					     Erlang Module Definition					    wxGraphicsMatrix(3erl)

NAME
wxGraphicsMatrix - See external documentation: wxGraphicsMatrix. DESCRIPTION
See external documentation: wxGraphicsMatrix . This class is derived (and can use functions) from: wxGraphicsObject DATA TYPES
wxGraphicsMatrix() : An object reference, The representation is internal and can be changed without notice. It can't be used for comparsion stored on disc or distributed for use on other nodes. EXPORTS
concat(This::wxGraphicsMatrix(), T::wxGraphicsMatrix()) -> ok See external documentation . get(This::wxGraphicsMatrix()) -> {A::float(), B::float(), C::float(), D::float(), Tx::float(), Ty::float()} See external documentation . getNativeMatrix(This::wxGraphicsMatrix()) -> ok See external documentation . invert(This::wxGraphicsMatrix()) -> ok See external documentation . isEqual(This::wxGraphicsMatrix(), T::wxGraphicsMatrix()) -> bool() See external documentation . isIdentity(This::wxGraphicsMatrix()) -> bool() See external documentation . rotate(This::wxGraphicsMatrix(), Angle::float()) -> ok See external documentation . scale(This::wxGraphicsMatrix(), XScale::float(), YScale::float()) -> ok See external documentation . translate(This::wxGraphicsMatrix(), Dx::float(), Dy::float()) -> ok See external documentation . set(This::wxGraphicsMatrix()) -> ok Equivalent to set(This, []) . set(This::wxGraphicsMatrix(), Options::[Option]) -> ok Types Option = {a, float()} | {b, float()} | {c, float()} | {d, float()} | {tx, float()} | {ty, float()} See external documentation . transformPoint(This::wxGraphicsMatrix()) -> {X::float(), Y::float()} See external documentation . transformDistance(This::wxGraphicsMatrix()) -> {Dx::float(), Dy::float()} See external documentation . AUTHORS
<> wxErlang 0.98.9 wxGraphicsMatrix(3erl)
All times are GMT -4. The time now is 07:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy