Sponsored Content
Top Forums Shell Programming and Scripting Converting a decimal into integer Post 302143288 by idro on Wednesday 31st of October 2007 12:39:48 PM
Old 10-31-2007
It works, but now I obtain, 37.0.
I'd want 37.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help: How do I ADD non-integer (decimal) values?

I am trying to create a script that will read from a file two non-integer values (decimals) and add those values together. For example, I want to add 1.51 and -2.37 together and get the sum. Any ideas? Thanks! (2 Replies)
Discussion started by: limshady411
2 Replies

2. Shell Programming and Scripting

Compare integer value with decimal

Hi all, I have a issue... Is it possible to compare integer value with decimal value. If it is not possible,then how can i compare 2 decimal values in born shell.thanks! (3 Replies)
Discussion started by: MARY76
3 Replies

3. Shell Programming and Scripting

Converting integer to String

Hi everyone, I would like to know how to convert an integer to a string. for instance if i=1 i would like to creat a variable called constant1. i want to do this in a for loop so for each value of i, i create a new variable such as constant2, constant3,... and so on. for i in 1 2 3 do ... (1 Reply)
Discussion started by: ROOZ
1 Replies

4. Shell Programming and Scripting

Converting decimal to integer

The shell mentioned below will show a warning if the page takes more than 6 seconds to load. The problem is that myduration variable is not an integer. How do I convert it to integer? myduration=$(curl http://192.168.50.1/mantisbt/view.php?id=1 -w %{time_total}) > /dev/null ; ] && echo... (3 Replies)
Discussion started by: shantanuo
3 Replies

5. UNIX for Dummies Questions & Answers

compare decimal and integer values in if in bash shell

i need to do camparisions like the below. For the case when first=10 and second=9.9 the scripts displays process failed. I need to be able to convert the values to integer before doing the comparision. Like 9.9 should be rounded over to 10 before doing comparision. Please advice how can... (3 Replies)
Discussion started by: nehagupta
3 Replies

6. Shell Programming and Scripting

truncate string to integer or decimal

From strings stored in variables, I need to isolate and use the first numerical value contained within them. I will need to know how to produce an integer as well as a floating point decimal. It needs to work on any string regardless of what types of characters (if any) are preceding or following... (3 Replies)
Discussion started by: bradlecat
3 Replies

7. Shell Programming and Scripting

[Solved] need to convert decimal to integer

Using below command awk 'NR==FNR{A=$1;next} {sum+=($2*A)}END{OFMT="%20f";print int(sum)}' Market.txt Product.txt answer:351770174.00000 how to convert this to 351770174. when i try with below command i am getting different result. awk 'NR==FNR{A=$1;next}... (3 Replies)
Discussion started by: katakamvivek
3 Replies

8. Shell Programming and Scripting

Converting string to integer

I have a function that is supposed to check for user processes and wait for 0 count before exiting the function. I am sure I have more than one issue in my code, but the stumbling block right now is that I am trying to convert the value of my variable from a string to integer. process_count... (10 Replies)
Discussion started by: MIA651
10 Replies

9. Shell Programming and Scripting

Column value can be Two integer post decimal or blank

Hi Experts, Need your advice. I have a csv file in which column value can contain two integer post decimal(like 1.00, 13.00,12.15, 2.43) or blank. Tried the below code but not working. awk -F "|" '{ if ($39 !~ /^+\.{2}$ || $39 != "") {print "165: Quantity decimal values are not correct... (2 Replies)
Discussion started by: as7951
2 Replies

10. Shell Programming and Scripting

Calculate the constant e to 14+ decimal places using integer maths.

Hi guys... I am loving this integer maths thing. 64 bit systems are certainly easier than 32 bit, but hey, I don't intend to leave out my fav' platform. Using one of the 'Brothers' methods, URL inside the code. #!/bin/sh # # #!/usr/local/bin/dash # e_constant.sh # Brother's formula . #... (2 Replies)
Discussion started by: wisecracker
2 Replies
atom_application_navigation(5)					File Formats Manual				    atom_application_navigation(5)

NAME
atom_application_navigation, GetFirstObj, GetLastObj, GetNextObj, GetPrevObj, GetFirstObjProc, GetLastObjProc, GetNextProc, GetPrevProc, GetFirstBlock, GetLastBlock, GetNextBlock, GetPrevBlock, GetFirstInst, GetLastInst, GetNextInst, GetPrevInst, GetProcObj, GetBlockProc, GetInstBlock, GetInstBranchTarget - Allows an Atom tool's instrumentation routine to find locations in an application program SYNOPSIS
#include <cmplrs/atom.inst.h> Obj *GetFirstObj( void ); Obj *GetLastObj( void ); Obj *GetNextObj( Obj * ); Obj *GetPrevObj( Obj * ); Proc *GetFirstObjProc( Obj * ); Proc *GetLastObjProc( Obj * ); Proc *GetNextProc( Proc * ); Proc *GetPrevProc( Proc * ); Block *GetFirstBlock( Proc * ); Block *GetLastBlock( Proc * ); Block *GetNextBlock( Block * ); Block *GetPrevBlock( Block * ); Inst *GetFirstInst( Block * ); Inst *GetLastInst( Block * ); Inst *GetNextInst( Inst * ); Inst *GetPrevInst( Inst * ); Inst *GetInstBranchTarget( Inst * ); Obj *GetProcObj( Proc * ); Proc *GetBlockProc( Block * ); Block *GetInstBlock( Inst * ); DESCRIPTION
Atom's application navigation routines allow an instrumentation routine to locate areas of an application that are interesting to monitor or analyze. You can use these routines only from an Atom tool's instrumentation file. See atom(1) for a description of Atom. Atom allows you view an application with the following granularity: The entire application, including all shared libraries. Either the main executable or a shared library. An object comprises a list of procedures and has it own set of attributes (for example, each object has its own name). A procedure. A basic block. An instruction. Note Do not confuse the term object with an object module produced by a compiler. The two terms are completely different. To traverse the list of objects in an application program, use the following routines: Use the GetFirstObj or GetLastObj routine to obtain a pointer to the first or last object in the program. Nonshared programs, have only one object. For call-shared programs, the first object corresponds to the main program and the remaining objects are its shared libraries. Use the GetNextObj routine to obtain a pointer to the object that follows the specified Obj. If the specified Obj is the last object in the program, GetNextObj returns a NULL pointer. Use the GetPrevObj routine to obtain a pointer to the object that precedes the specified Obj. If the specified Obj is the first object in the pro- gram, GetPrevObj returns a NULL pointer. Note Because the Instrument routine is called for each object in the program, the object traversal routines in the Instrument do not need to be used routine. To traverse the list of procedures in an object, use the following routines: Use the GetFirstObjProc or GetLastObjProc routine to obtain a pointer to the first or last procedure in the specified Obj. Use the GetNextProc routine to obtain a pointer to the procedure that follows the specified Proc. If the specified Proc is the last procedure in the object, GetNextProc returns a NULL pointer. Use the GetPrevProc routine to obtain a pointer to the procedure that precedes the specified Proc. If the specified Proc is the first procedure in the object, GetPrevProc returns a NULL pointer. To traverse the list of basic blocks in a procedure, use the following routines: Use the GetFirstBlock or GetLastBlock routine to obtain a pointer to the first or last basic block in the specified Proc. Use the GetNextBlock routine to obtain a pointer to the basic block that follows the specified Block. If the specified Block is the last basic block in the procedure, GetNextBlock returns a NULL pointer. Use the GetPrevBlock routine to obtain a pointer to the basic block that precedes the specified Block. If the specified Block is the first basic block in the procedure, GetPrevBlock returns a NULL pointer. To traverse the instructions in a basic block, use the following routines: Use the GetFirstInst or GetLastInst routine to obtain a pointer to the first or last instruction in the specified Block. Use the GetNextInst routine to obtain a pointer to the instruction that follows the specified Inst. If the specified Inst is the last instruction in the basic block, GetNextInst returns a NULL pointer. Use the Get- PrevInst routine to obtain a pointer to the instruction that precedes the specified Inst. If the specified Inst is the first instruction in the basic block, GetPrevInst returns a NULL pointer. Use the GetInstBranchTarget routine to obtain a pointer to the instruction that is the target of Inst. An error is raised if Inst is not a branch instruction. To navigate between the parts of an application, use the following routines: Use the GetProcObj routine to obtain a pointer to the object that contains the specified Proc. Use the GetBlockProc routine to obtain a pointer to the procedure that contains the specified Block. Use the GetInstBlock routine to obtain a pointer to the basic block that contains the specified Inst. RETURN VALUES
These routines return pointers to Obj, Proc, Block, and Inst structures, or NULL pointers, as described in the preceding section. FILES
Header file containing external definitions of Atom routines SEE ALSO
Commands: atom(1) AtomTools: hiprof(5), pixie(5), third(5) Functions: atom_application_instrumentation(5), atom_application_query(5), atom_application_resolvers(5), atom_description_file(5), atom_object_management(5), atom_instrumentation_routines(5), AnalHeapBase(5), Xlate(5), Thread(5) Programmer's Guide atom_application_navigation(5)
All times are GMT -4. The time now is 08:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy