12-31-2007
3,6,9,12 all have a remainder of zero when divided by 3. The other months will have a non-zero remainder. You can use month%3 as the test. If you must have variable called inc_flg with the above mentioned properties, you could just do:
((inc_flg=2-!(month%3)))
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
....does the dbms_output.put_line work inside unix shell script?
i mean this is to be inside the sqlplus connection as follows!!
sqlplus -s $UP <<EOJ
..
..
..
dbms_output.put_line ('Insertion procedure failed for UPC BC : ' || wk_key_value || ' Sqlcode: ' || SQLCODE || ' Error... (2 Replies)
Discussion started by: mexx_freedom
2 Replies
2. UNIX for Dummies Questions & Answers
i am used to making scripts for hp-ux. but lately i tried to make some for solaris. the problem is that when i tried to execute it it gave me an error the "let: not found". why is that? how can i perform an arithmetic function in the solaris shell script?
thanks :) (2 Replies)
Discussion started by: inquirer
2 Replies
3. Shell Programming and Scripting
hello all,
i am having a variable with a value of 0000010000 and if i add the variable with some no:
suppose
i=0000010000
n=`expr $i + 1`
echo $n
the output i am reciving is 10001 .it deletes all the zeros
but i need result as 0000010001..
please help me...
thanks in... (3 Replies)
Discussion started by: ithirak17
3 Replies
4. Programming
Hello,
I'm working on an application that bridges together several applications involved in creating a video workflow for editing with digital cinema cameras. The main platform is MacOSX.
Because of the nature of some of the utilities for working with this video footage I must spoof filenames... (2 Replies)
Discussion started by: ibloom
2 Replies
5. Shell Programming and Scripting
Hi all,
I have wriiten an expect script that genearates a public private key pair through ssh-keygen and then copies that key to the authorized keys file of the remote system . The problem i am facing is when i get a password for the remote machine containg a trailing backslash , the send command... (4 Replies)
Discussion started by: pradeeptyagi23
4 Replies
6. Shell Programming and Scripting
Hello everybody,
I decided to take a Unix Introduction class and have never had experience with programming. Everything was fine until recently when the Prof. started shell scripting and he wants us to make a small script to add unlimited numbers from arguments and from standard input.
I... (1 Reply)
Discussion started by: Florinel76
1 Replies
7. Homework & Coursework Questions
Hello everybody,
I decided to take a Unix Introduction class and have never had experience with programming. Everything was fine until recently when the Prof. started shell scripting and he wants us to make a small script to add unlimited numbers from arguments and from standard input.
I... (8 Replies)
Discussion started by: Florinel76
8 Replies
8. Shell Programming and Scripting
Hello All,
I am trying to come up with a shell script to count a specific word in a logfile on each day of this month, last month and the month before. I need to produce this report and email it to customer.
Any ideas would be appreciated! (5 Replies)
Discussion started by: pnara2
5 Replies
9. Shell Programming and Scripting
Dear unix wizards,
I'd be very grateful for your help with the following.
I have a hypothetical file (file.txt) with three columns:
111 4 0.01
112 3 0.02
113 2 0.03
114 1 0.04
115 1 0.06
116 2 0.02
117 3 0.01
118 4 0.05
Column 2 consists of pairs of integers from 1 to 4 (each... (5 Replies)
Discussion started by: aberg
5 Replies
10. Cybersecurity
Hello,
with the following problem I feel helpless because I do not know where to look for the problem.
Sorry in advance for my poor English.
At some point the interaction with people on Freenode IRC has become mysterious and offending so that I checked my modem/router device. When I tried to... (2 Replies)
Discussion started by: SInt
2 Replies
LEARN ABOUT SUNOS
remainderl
remainder(3M) Mathematical Library Functions remainder(3M)
NAME
remainder, remainderf, remainderl - remainder function
SYNOPSIS
cc [ flag... ] file... -lm [ library... ]
#include <math.h>
double remainder(double x, double y);
float remainderf(float x, float y);
long double remainderl(long double x, long double y);
DESCRIPTION
These functions return the floating point remainder r = x - ny when y is non-zero. The value n is the integral value nearest the exact
value x/y. When |n - x/y| = 1/2, the value n is chosen to be even.
The behavior of remainder() is independent of the rounding mode.
RETURN VALUES
Upon successful completion, these functions return the floating point remainder r = x - ny when y is non-zero.
If x or y is NaN, a NaN is returned.
If x is infinite or y is 0 and the other is non-NaN, a domain error occurs and a NaN is returned.
ERRORS
These functions will fail if:
Domain Error The x argument is +-Inf, or the y argument is +-0 and the other argument is non-NaN.
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception is
raised.
The remainder() function sets errno to EDOM if y argument is 0 or the x argument is positive or negative infinity.
USAGE
An application wanting to check for error situations can set errno to 0 before calling remainder(). On return, if errno is non-zero, an
error has occurred. The remainderf() and remainderl() functions do not set errno.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO
abs(3C), div(3C), feclearexcept(3M), fetestexcept(3M), attributes(5), standards(5)
SunOS 5.10 1 Nov 2003 remainder(3M)