Hi anyone,
i need to compare two decimal numbers
i thought that it could be do it with if but... :(
So, i'm writing in csh and i really apreciate if anyone can help me
if ( $ppl_kn <= $ppl_wb ) then
echo "############# KNdiscount model has the lowest perplexity"
set... (5 Replies)
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)
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)
Hi,
I have a column in 2 different files which i want to compare, and output the results to a different file. The columns are in different positions in those 2 files.
File 1 the column is in position 10-15
File 2 the column is in position 15-20
Please advise
Thanks (1 Reply)
Hi
I have a input file with many fields and each filed will be with in double quotes(""). i want to check fields contains balnk,null or space using condition using if. when i write code as below for if condition its not working
a=`awk -F ',' '{gsub("\"", "", $1);'NF==0';printf $1}'... (3 Replies)
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)
I need decimal comparing with if. Check if apache version is less than 2.2.17.
I tried this and not working.
#!/bin/bash
apachever=`/usr/local/apache/bin/httpd -v | head -1 | awk '{print $3}' |cut -d/ -f 2`
if ]; then
echo "Apache version less than 2.2.17"
else
... (7 Replies)
I have 2 files say tp1.txt and tp2.txt having following data
cat tp1.txt
abc,2.20,IN20
acb,3.15,DN10
bca,3,RD10
cat tp2.txt
alv,1.00,IN20
aaa,4.05,DD10
abb,5.50,RD12
i want to compare the values on 2nd field of both the file, if value of first tp1.txt is greater than value... (3 Replies)
Hi,
I am facing some error while doing the comparision between 2 decimal values in bash. Pl help me out.
I have tried using below scripts. But its giving me error.
1)amt=12.3 opn_amt=12.5 var=$(awk 'BEGIN{ print "'$amt'"<"'$opn_amt'" }')
if ;then echo "correct" else echo "Wrong"... (3 Replies)
i have the following files (all separated by tabs):
file 1.txt
1 yes
2 no
3 yes
4 yes
file 2.txt
a no
b no
c yes
d no
i combine the above files in file 3 which looks like
file 3.txt
1 yes a no
2 no b no
3 yes c yes
4 yes d no
now, i need to compare the values between column 2... (3 Replies)
Discussion started by: msonoth
3 Replies
LEARN ABOUT DEBIAN
shevek_relative_time
shevek::relative_time(3) Library Functions Manual shevek::relative_time(3)NAME
shevek::relative_time -
Time interval.
SYNOPSIS
#include <time.hh>
Public Member Functions
relative_time ()
The default constructor creates an interval of 0.
relative_time (timetype days, int hours, int minutes, int seconds, int nanoseconds=0)
Construct an interval of a given size.
relative_time (timetype seconds, unsigned nanoseconds)
Fast constructor.
relative_time operator+ (relative_time that) const
Add two intervals.
absolute_time operator+ (absolute_time that) const
Add an interval to a moment.
relative_time operator- (relative_time that) const
Subtract two intervals.
relative_time operator- () const
Negate an interval.
relative_time operator* (float c) const
Scale an interval.
relative_time operator/ (float c) const
Scale an interval.
relative_time operator% (relative_time that) const
Modulo operator for two intervals.
double operator/ (relative_time that) const
Division of two intervals.
relative_time & operator+= (relative_time that)
Add an interval.
relative_time & operator-= (relative_time that)
Subtract an interval.
relative_time & operator*= (float c)
Scale the interval.
relative_time & operator/= (float c)
Scale the interval.
relative_time & operator%= (relative_time that)
Modulo.
bool operator< (relative_time that) const
Compare with another interval.
bool operator> (relative_time that) const
Compare with another interval.
bool operator<= (relative_time that) const
Compare with another interval.
bool operator>= (relative_time that) const
Compare with another interval.
bool operator== (relative_time that) const
bool operator!= (relative_time that) const
unsigned nanoseconds () const
Number of nanoseconds.
unsigned seconds () const
Number of seconds.
unsigned minutes () const
Number of minutes.
unsigned hours () const
Number of hours.
unsigned days () const
Number of days.
bool isnegative () const
Is this a negative interval?
timetype total () const
Total number of seconds, as encoded.
Static Public Member Functions
static void set_digits (unsigned num)
Set number of digits to use when printing (for fractions of seconds).
static unsigned get_digits ()
Get the number of digits that is used when printing.
Friends
std::ostream & operator<< (std::ostream &s, relative_time t)
Write the interval to a std::ostream.
Detailed Description
Time interval.
Constructor & Destructor Documentation
shevek::relative_time::relative_time (timetypeseconds, unsignednanoseconds)
Fast constructor. This directly fills the members and is therefore slightly faster than the other constructors. However, the others aren't
really slow either.
Member Function Documentation
bool shevek::relative_time::operator!= (relative_timethat) const Compare two intervals. Note that this is rarely a useful operation, because
minor errors may be introduced by computations.
bool shevek::relative_time::operator== (relative_timethat) const Compare two intervals. Note that this is rarely a useful operation, because
minor errors may be introduced by computations.
Author
Generated automatically by Doxygen for libshevek from the source code.
libshevek Fri May 11 2012 shevek::relative_time(3)