Sponsored Content
Top Forums Shell Programming and Scripting Convert floating point to a number Post 303004175 by skatpally on Wednesday 27th of September 2017 03:21:33 PM
Old 09-27-2017
Convert floating point to a number

Hello Guys,
I have a floating point number 1.14475E+15 I want to convert this number in to full number (Integer or Big integer). I tried couple of functions it did not work. When I use INT=${FLOAT/.*} I am getting value as 1. I don't want a truncated value

Code:
#!/bin/bash
# Welcome to the Interactive Shell Tutorial.
# Start by choosing a chapter and
# write your code in this window.
FLOAT=1.14475E+15
#INT=${FLOAT/.*}
#INT=${FLOAT/\.*}
S[i] = INT(1.14475E+15)
echo $S[i]

Thanks

Last edited by RudiC; 09-27-2017 at 05:38 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

floating point addition

hi, :) I have a file like this 10.456 123.567 456.876 234.987 ........ ....... What i want to do is ia have to add all those numbers and put the result in some other file. Any help pls. cheers RRK (8 Replies)
Discussion started by: ravi raj kumar
8 Replies

2. Programming

floating point problem

Hi all! Hi all! I am working with a problem to find the smallest floating point number that can be represented. I am going in a loop ,stating with an initial value of 1.0 and then diving it by 10 each time thru the loop. So the first time I am getting o.1 which I wanted.But from the next... (4 Replies)
Discussion started by: vijlak
4 Replies

3. Programming

Floating point error in C

Hi, see the simple code below double i; i=8080.9940; printf(" val :%.30f\n",i); output i m getting is val :8080.993999999999700000000000000 when i m expecting val :8080.9940 what happens?how can i avoid it? thanks... (2 Replies)
Discussion started by: Hara
2 Replies

4. Linux

Floating point exception !!!

Hi, I have linux fedora 4 ver., 2.6 kernal. And qmail & mysql & samba servers are already configured on this server. When I try to install any package like squidguard ,dansguardian,webmin,rsnapshots with command rpm -ivh . It is giving error as “Floating point exception" Snap View is... (3 Replies)
Discussion started by: ssk01
3 Replies

5. Shell Programming and Scripting

using bc with floating point number in files

Hi, I' using bash and I would like to use "bc" to compute the ratio of of two numbers and assign the ratio to a variable. The numbers are in a file, e.g. 196.304492 615.348986 Any idea how to do it? N.B. I cannot change the file to have 196.304492 / 615.348986 as the file is produced by... (14 Replies)
Discussion started by: f_o_555
14 Replies

6. Shell Programming and Scripting

floating point number problem

Hello folks I Hope everyone is fine. I am calculating number of bytes calculation from apache web log. awk '{ sum += $10 } END { print sum }' /var/httpd/log/mydomain.log 7.45557e+09 it show above number, what should i do it sow number like 7455, i mean if after decimal point above 5 it... (5 Replies)
Discussion started by: learnbash
5 Replies

7. Shell Programming and Scripting

problem with floating point number loops

Hey, I guess I am just to stupid and am not seeing the "wood for the trees", but I am always getting strange errors. I want to create a mesh with coordinates like: x y z 3.1 3.0 0.75 0 0 1 3.1 2.9 0.75 0 0 1 3.1 2.8 0.75 0 0 1 3.1 2.7 0.75 0 0 1 3.0 ... (10 Replies)
Discussion started by: ergy1983
10 Replies

8. Programming

Floating Point

Anyone help me i cant found the error of floating point if needed, i added the code complete #include <stdio.h> #include <string.h> #include <stdlib.h> #include <ctype.h> typedef struct { int hh; int mm; int ss; char nom; int punt; }cancion; typedef struct... (9 Replies)
Discussion started by: Slasho
9 Replies

9. Shell Programming and Scripting

[BASH] Regex for floating point number

Hey again, I have a basic regex that tests if a number is a float. Thank you. (5 Replies)
Discussion started by: whyte_rhyno
5 Replies

10. Shell Programming and Scripting

Bash script to print the smallest floating point number in a row that is not 0

Hello, I have often found bash to be difficult when it comes to floating point numbers. I have data with rows of tab delimited floating point numbers. I need to find the smallest number in each row that is not 0.0. Numbers can be negative and they do not come in any particular order for a given... (9 Replies)
Discussion started by: LMHmedchem
9 Replies
SUMO(1) 							   User Commands							   SUMO(1)

NAME
SUMO - Road network generator for the microscopic road traffic simulation SUMO SYNOPSIS
netgensumo [OPTION]* DESCRIPTION
SUMO netgensumo Version 0.15.0 Copyright (C) 2001-2012 DLR and contributors; http://sumo.sourceforge.net Road network generator for the microscopic road traffic simulation SUMO. Either "--grid", "--spider" or "--rand" must be supplied. In dependance to these switches other options are used. Configuration Options: -c, --configuration-file FILE Loads the named config on startup --save-configuration FILE Saves current configuration into FILE --save-template FILE Saves a configuration template (empty) into FILE --save-schema FILE Saves the configuration schema into FILE --save-commented Adds comments to saved template, configuration, or schema Grid Network Options: -g, --grid Forces NETGENSUMO to build a grid-like network --grid.number INT The number of junctions in both dirs --grid.length FLOAT The length of streets in both dirs --grid.x-number INT The number of junctions in x-dir; Overrides --grid-number --grid.y-number INT The number of junctions in y-dir; Overrides --grid-number --grid.x-length FLOAT The length of horizontal streets; Overrides --grid-length --grid.y-length FLOAT The length of vertical streets; Overrides --grid-length --grid.attach-length FLOAT The length of streets attached at the boundary; 0 means no streets are attached Spider Network Options: -s, --spider Forces NETGENSUMO to build a spider-net-like network --spider.arm-number INT The number of axes within the net --spider.circle-number INT The number of circles of the net --spider.space-radius FLOAT The distances between the circles --spider.omit-center Omit the central node of the network Random Network Options: -r, --rand Forces NETGENSUMO to build a random network --rand.iterations INT Describes how many times an edge shall be added to the net --rand.bidi-probability FLOAT Defines the probability to build a reverse edge --rand.max-distance FLOAT --rand.min-distance FLOAT --rand.min-angle FLOAT --rand.num-tries INT --rand.connectivity FLOAT --rand.neighbor-dist1 FLOAT --rand.neighbor-dist2 FLOAT --rand.neighbor-dist3 FLOAT --rand.neighbor-dist4 FLOAT --rand.neighbor-dist5 FLOAT --rand.neighbor-dist6 FLOAT Output Options: -o, --output-file FILE The generated net will be written to FILE --plain-output-prefix FILE Prefix of files to write plain xml nodes, edges and connections to --junctions.join-output FILE Writes information about joined junctions to FILE (can be loaded as additional node-file to reproduce joins -M, --map-output FILE Writes joined edges information to FILE --matsim-output FILE The generated net will be written to FILE using MATsim format. --opendrive-output FILE The generated net will be written to FILE using openDRIVE format. --output.street-names Street names will be included in the output (if available). TLS Building Options: --tls.set STR Interprets STR as list of junctions to be controlled by TLS --tls.unset STR Interprets STR as list of junctions to be not controlled by TLS --tls.guess Turns on TLS guessing --tls-guess.joining Includes node clusters into guess --tls.join Tries to cluster tls-controlled nodes --tls.green.time INT Use INT as green phase duration -D, --tls.yellow.min-decel FLOAT Defines smallest vehicle deceleration --tls.yellow.patch-small Given yellow times are patched even if being too short --tls.yellow.time INT Set INT as fixed time for yellow phase durations --tls.half-offset STR TLSs in STR will be shifted by half-phase --tls.quarter-offset STR TLSs in STR will be shifted by quarter-phase Edge Removal Options: --keep-edges.min-speed FLOAT Only keep edges with speed > FLOAT --remove-edges.explicit STR Remove edges in STR --keep-edges.explicit STR Only keep edges in STR --keep-edges.input-file FILE Only keep edges in FILE --keep-edges.in-boundary STR Only keep edges which are located within the given boundary (given either as CARTESIAN corner coordinates <xmin,ymin,xmax,ymax> or as polygon <x0,y0,x1,y1,...>) Unregulated Nodes Options: --keep-nodes-unregulated All nodes will be unregulated --keep-nodes-unregulated.explicit STR Do not regulate nodes in STR --keep-nodes-unregulated.district-nodes Do not regulate district nodes Processing Options: --no-internal-links Omits internal links --no-turnarounds Disables building turnarounds --no-turnarounds.tls Disables building turnarounds at tls-controlled junctions --no-left-connections Disables building connections to left --offset.disable-normalization Turn off normalizing node positions --offset.x FLOAT Adds FLOAT to net x-positions --offset.y FLOAT Adds FLOAT to net y-positions --flip-y-axis Flips the y-coordinate along zero --roundabouts.guess Enable roundabout-guessing --lefthand Assumes left-hand traffic on the network --junctions.join Joins junctions that are close to each other (recommended for OSM import) --junctions.join-dist FLOAT Determines the maximal distance for joining junctions (defaults to 15) Building Defaults Options: -L, --default.lanenumber INT The default number of lanes in an edge -S, --default.speed FLOAT The default speed on an edge (in m/s) -P, --default.priority INT The default priority of an edge -j, --default-junction-type STR [traffic_light|priority|right_before_left] Determines the type of the build junctions Report Options: -v, --verbose Switches to verbose output -p, --print-options Prints option values before processing -?, --help Prints this screen -V, --version Prints the current version -W, --no-warnings Disables output of warnings -l, --log FILE Writes all messages to FILE (implies verbose) --message-log FILE Writes all non-error messages to FILE (implies verbose) --error-log FILE Writes all warnings and errors to FILE Random Number Options: --random Initialises the random number generator with the current system time --seed INT Initialises the random number generator with the given value EXAMPLES
netgensumo -c <CONFIGURATION> create net from given configuration netgensumo --grid [grid-network options] -o <OUTPUTFILE> create grid net netgensumo --spider [spider-network options] -o <OUTPUTFILE> create spider net netgensumo --rand [random-network options] -o <OUTPUTFILE> create random net REPORTING BUGS
Report bugs at <http://sourceforge.net/apps/trac/sumo/>. Get in contact via <sumo-user@lists.sourceforge.net>. Copyright (C) 2001-2012 DLR and contributors; http://sumo.sourceforge.net SUMO netgensumo Version 0.15.0 is part of SUMO. SUMO is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/gpl.html SUMO netgensumo Version 0.15.0 May 2012 SUMO(1)
All times are GMT -4. The time now is 01:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy