04-14-2003
In ksh you can do:
x=123.45
echo ${#x} is the length of x
echo ${x%.*} is the integer portion of x
10 More Discussions You Might Find Interesting
1. Programming
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
2. Shell Programming and Scripting
Hi All,
I need to generate 4 digit random no using only shell script.
Please help in this ASAP.
Thanks in advance...
Regards,
sridhar. (1 Reply)
Discussion started by: sridhusha
1 Replies
3. Shell Programming and Scripting
Hi All,
can some body help me to script the below logic. Basically am facing
problem with float calculation. Also i need this to be done inside a single awk.
I tried lot of tuning but still nothing is getting displayed, nor any errors
param=50
value=19.23
for(i=0;i<4;i++)
{... (2 Replies)
Discussion started by: jisha
2 Replies
4. Shell Programming and Scripting
Hi
pls help me with this if clause , which is marked in red .
It gives me an error saying :-
: integer expression expected
and it goes to the else part and writes output the WARNING STATEMENTS ..
the values of if ; then
rcInPAudit and rcInP match each other exactly ..but it does not... (5 Replies)
Discussion started by: rxg
5 Replies
5. Shell Programming and Scripting
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
Hi, i am making a simple program with a optional -t as the 3rd parameter.
Submit course assignment -t dir
In the script, i wrote:
#!/bin/bash
echo "this is course: ${1}"
echo "this is assignment #: ${2}"
echo "late? : ${3}"
if then
echo "this is late"
fi
but this gives me a
:... (3 Replies)
Discussion started by: leonmerc
3 Replies
7. Shell Programming and Scripting
hi,
how to I do this?
i="4.000"
if ; then
echo "smaller"
fi
how do I convert the "4.000" to 4?
Thanks! (4 Replies)
Discussion started by: h0ujun
4 Replies
8. Shell Programming and Scripting
Hi guys,
I'm new here. I have a problem at work. One of our scripts was eventually having a bug and only detected recently. Here's the issue and background:
Bash Script which calls AWK script
Awk script returns a string as per below (example):var1='00000-123'So, when we convert it, the... (18 Replies)
Discussion started by: sekfarok
18 Replies
9. Shell Programming and Scripting
Working out a small problem, I have a need of a Perl snippet which might look something like this:
use integer;
...
if ($changingNumber / 2)
{
do something;
}
else
{
do something else;
}
...
What I want to happen is for "if" to resolve as "true" every time a whole... (3 Replies)
Discussion started by: LinQ
3 Replies
10. Programming
Hello !
I'm creating a CGI which allow to display graph from some data.
The datas looks like :
2020-01-13-00-00,384.00,350.00
2020-01-13-06-00,384.00,350.00
2020-01-13-12-00,384.00,350.00
2020-01-13-18-00,384.00,350.00
2020-01-14-00-00,384.00,350.00... (1 Reply)
Discussion started by: Tim2424
1 Replies
LEARN ABOUT SUSE
gtk2::curve
Gtk2::Curve(3) User Contributed Perl Documentation Gtk2::Curve(3)
NAME
Gtk2::Curve
HIERARCHY
Glib::Object
+----Glib::InitiallyUnowned
+----Gtk2::Object
+----Gtk2::Widget
+----Gtk2::DrawingArea
+----Gtk2::Curve
INTERFACES
Glib::Object::_Unregistered::AtkImplementorIface
Gtk2::Buildable
METHODS
widget = Gtk2::Curve->new
$curve->set_curve_type ($type)
o $type (Gtk2::CurveType)
$curve->set_gamma ($gamma)
o $gamma (double)
$curve->set_range ($min_x, $max_x, $min_y, $max_y)
o $min_x (double)
o $max_x (double)
o $min_y (double)
o $max_y (double)
$curve->reset
list = $curve->get_vector ($veclen=32)
o $veclen (integer)
Returns a list of real numbers, the curve's vector.
$curve->set_vector (...)
o ... (list) of float's, the points of the curve
PROPERTIES
'curve-type' (Gtk2::CurveType : readable / writable / private)
Is this curve linear, spline interpolated, or free-form
'max-x' (Glib::Float : readable / writable / private)
Maximum possible X value
'max-y' (Glib::Float : readable / writable / private)
Maximum possible value for Y
'min-x' (Glib::Float : readable / writable / private)
Minimum possible value for X
'min-y' (Glib::Float : readable / writable / private)
Minimum possible value for Y
SIGNALS
curve-type-changed (Gtk2::Curve)
ENUMS AND FLAGS
enum Gtk2::CurveType
o 'linear' / 'GTK_CURVE_TYPE_LINEAR'
o 'spline' / 'GTK_CURVE_TYPE_SPLINE'
o 'free' / 'GTK_CURVE_TYPE_FREE'
SEE ALSO
Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::DrawingArea
COPYRIGHT
Copyright (C) 2003-2008 by the gtk2-perl team.
This software is licensed under the LGPL. See Gtk2 for a full notice.
perl v5.12.1 2010-07-05 Gtk2::Curve(3)