Sponsored Content
Top Forums Shell Programming and Scripting SH if statement using FLOAT values Post 302297779 by vgersh99 on Sunday 15th of March 2009 10:25:02 AM
Old 03-15-2009
Quote:
Originally Posted by ripat
I would have thought that all version of ksh support floating point calculation/comparison.

Mine does:

Code:
a=1.699999
b=1.7
if [[ $a < $b ]];then echo $a smaller than $b;fi

ksh version M 1993-12-28 s+
don't know about k93, but k88 does not.
The OP is actually asking about Bourne - the above should work Bourne as well.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Code checking for all values in the same if statement.

I am trying to set up a variable based on the name of the file. function script_name { if then job_name='MONITOR' return job_name; elsif then job_name='VERSION' return job_name fi } for i in `ls *log` do script_name $i done. (4 Replies)
Discussion started by: oracle8
4 Replies

2. Shell Programming and Scripting

comparing two float values

I am trying to compare 2 float values using if the foll code does not work a=1.4 b=1.6 if test $a -gt $b then echo "$a is max" else echo "$b is max" fi does -gt work for floating point numbers, if not how do go about for my requirement? can i use bc ? pls help thanks in advance... (2 Replies)
Discussion started by: kavitha
2 Replies

3. UNIX for Dummies Questions & Answers

Dividing float values

Hi I know its a dumb question but can any one please explain me the difference of executing a shell script in the following 2 ways. . script.sh sh script.sh I have a problem if I execute the following code as sh script.sh DB_CNT_ALW=0.20 SCT_VAR=0.05 if ; then echo "== Difference... (3 Replies)
Discussion started by: shash
3 Replies

4. 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

5. Shell Programming and Scripting

Iterative statement to cut values from a line

Hi I am new to shell scripting and trying to get values from a text file, I have a text file with values seperated with "|". like aga|120220090525|120220090525|120220090525|120220090530 bab|120220090530|120220090530|120220090535|120220090535|120220090535... (4 Replies)
Discussion started by: mannepalli
4 Replies

6. Shell Programming and Scripting

float input

how to input float data type in bash shell programming in linux? I am new to it so unaware to use the commands plz help me out. thank you. (6 Replies)
Discussion started by: purva
6 Replies

7. UNIX for Advanced & Expert Users

Get Minimun from a Float values

Hi Guys, here is a part of my source code. This part is reponsible to get the minimun of a few values: .......... MAX=0.00 for a in `cat $OFILE` do if then ... (2 Replies)
Discussion started by: Paat
2 Replies

8. Red Hat

What is float IP?

:confused:We have two servers one active and one stand by as follows Active 202.61.9.9 Stand by 202.61.9.10 Float IP 202.61.9.8 What is use of this float IP? How it is configured? (1 Reply)
Discussion started by: manalisharmabe
1 Replies

9. Programming

Printing float values in C

Hi, I have small problem to print float value in the fallowing code float Cx, W,f=250000, Cr=92.00,pi=3.14; W=2*pi*f; Cx = 1/W.Cr; //Cx value will be come around like 7.07E-9. printf("capacitance value: %.10f",Cx); I am trying to print Cx value using above code but it was not... (3 Replies)
Discussion started by: veerubiji
3 Replies

10. Shell Programming and Scripting

Pass values to case statement in a function korn shell

I'm in the process of writng a function that consists of a case statement is there a way of calling the function and passing a value to it? ie function1 () { case opt1 do ..... opt2 do..... esac } function opt1 I'm aware the syntax is not correct, but you get the general idea. (1 Reply)
Discussion started by: squrcles
1 Replies
SQL-TYPES-WITH-PDO_4D-AND-PHP(3)					 1					  SQL-TYPES-WITH-PDO_4D-AND-PHP(3)

SQL types with PDO_4D and PHP - SQL types with PDO_4D and PHP

       Supported SQL types

       +-----------------+--------------------------------------+---+
       |  Type SQL 4D	 |					|   |
       |		 |					|   |
       |		 |	      Equivalent 4D		|   |
       |		 |					|   |
       |		 |		   Note 		|   |
       |		 |					|   |
       +-----------------+--------------------------------------+---+
       | ALPHA_NUMERIC	 |					|   |
       |		 |					|   |
       |		 |		   TEXT 		|   |
       |		 |					|   |
       |		 |					|   |
       |		 |		T{ VARCHAR		|   |
       |		 |					|   |
       |		 |		   TEXT 		|   |
       |		 |					|   |
       |		 |					|   |
       |		 |		 T{ TEXT		|   |
       |		 |					|   |
       |		 |		   TEXT 		|   |
       |		 |					|   |
       |		 |					|   |
       |		 |	       T{ TIMESTAMP		|   |
       |		 |					|   |
       |		 |		   DATE 		|   |
       |		 |					|   |
       |		 |					|   |
       |		 |	       T{ INTERVAL		|   |
       |		 |					|   |
       |		 |		   HOUR 		|   |
       |		 |					|   |
       |		 |					|   |
       |		 |	       T{ DURATION		|   |
       |		 |					|   |
       |		 |		   HOUR 		|   |
       |		 |					|   |
       |		 |					|   |
       |		 |		T{ BOOLEAN		|   |
       |		 |					|   |
       |		 |		 BOOLEAN		|   |
       |		 |					|   |
       |		 |					|   |
       |		 |		  T{ BIT		|   |
       |		 |					|   |
       |		 |		 BOOLEAN		|   |
       |		 |					|   |
       |		 |					|   |
       |		 |		 T{ BYTE		|   |
       |		 |					|   |
       |		 |		  INT32 		|   |
       |		 |					|   |
       |		 |					|   |
       |		 |		 T{ INT16		|   |
       |		 |					|   |
       |		 |		 SMALLINT		|   |
       |		 |					|   |
       |		 |					|   |
       |		 |	       T{ SMALLINT		|   |
       |		 |					|   |
       |		 |		 SMALLINT		|   |
       |		 |					|   |
       |		 |					|   |
       |		 |		 T{ INT32		|   |
       |		 |					|   |
       |		 |		  INT32 		|   |
       |		 |					|   |
       |		 |					|   |
       |		 |		  T{ INT		|   |
       |		 |					|   |
       |		 |		  INT32 		|   |
       |		 |					|   |
       |		 |					|   |
       |		 |		 T{ INT64		|   |
       |		 |					|   |
       |		 |		  INT64 		|   |
       |		 |					|   |
       |		 |					|   |
       |		 |		T{ NUMERIC		|   |
       |		 |					|   |
       |		 |		  INT64 		|   |
       |		 |					|   |
       |		 |					|   |
       |		 |		 T{ REAL		|   |
       |		 |					|   |
       |		 |		   REAL 		|   |
       |		 |					|   |
       |		 | Unsupported (use VARCHAR conversion) |   |
       |		 |					|   |
       |     FLOAT	 |					|   |
       |		 |					|   |
       |		 |		  FLOAT 		|   |
       |		 |					|   |
       |		 | Unsupported (use VARCHAR conversion) |   |
       |		 |					|   |
       |DOUBLE PRECISION |					|   |
       |		 |					|   |
       |		 |		  FLOAT 		|   |
       |		 |					|   |
       |		 |					|   |
       |		 |		 T{ BLOB		|   |
       |		 |					|   |
       |		 |		   BLOB 		|   |
       |		 |					|   |
       |		 | Must  use  a prepared statement, and |   |
       |		 | PDO::PARAM_LOB			|   |
       |		 |					|   |
       |  BIT VARYING	 |					|   |
       |		 |					|   |
       |		 |		   BLOB 		|   |
       |		 |					|   |
       |		 | Must use a prepared	statement,  and |   |
       |		 | PDO::PARAM_LOB			|   |
       |		 |					|   |
       |      CLOB	 |					|   |
       |		 |					|   |
       |		 |		   TEXT 		|   |
       |		 |					|   |
       |		 |					|   |
       |		 |		T{ PICTURE		|   |
       |		 |					|   |
       |		 |		 PICTURE		|   |
       |		 |					|   |
       |		 | Must  use  a prepared statement, and |   |
       |		 | PDO::PARAM_LOB			|   |
       |		 |					|   |
       +-----------------+--------------------------------------+---+
PHP Documentation Group 											  SQL-TYPES-WITH-PDO_4D-AND-PHP(3)
All times are GMT -4. The time now is 09:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy