pair number

N

nour

Guest
hello!

please how to check, by a skill function, that a number is pair?

please answer me now, i'm in the office!!!

Nour
 
Hi Nour,

I like the way you're asking help ;-) Some other people would rather
take it badly !
We don't work on Sundays here in Europe so chances to get somebody are
very weak ...
Anyway, you should have read the SKILL Language User Guide more often
because all those kind of questions are answered in there.
Please give a look at Chapter 5, Arithmetic and Logical Expressions.
You will find the following:

Arithmetic Predicate Functions

minusp(n) t if n is a negative number, nil otherwise
plusp(n) t if n is a positive number, nil otherwise
onep(n) t if n is equal to 1, nil otherwise
zerop(n) t if n is equal to 0, nil otherwise
evenp(x) t if x is an even integer, nil otherwise
oddp(x) t if x is an odd integer, nil otherwise

The function you're looking for is: evenp

Riad.

PS (sorry guys, it's in French).
Le mot 'pair' existe en Anglais egalement mais c'est un faux ami, cad
qu'il n'a pas le meme sens que le mot Francais. Le 'pair' en question
se traduit par 'even' en Anglais et 'odd' pour impair. C'est tres
simple a retenir en Anglais puisque 'even' est nombre pair de lettre
et 'odd' est un nombre impair. Pour plus de details sur la
signification de pair en Anglais:
http://en.wiktionary.org/wiki/pair
A+
 
Riad KACED wrote, on 06/15/08 22:23:
PS (sorry guys, it's in French).
Le mot 'pair' existe en Anglais egalement mais c'est un faux ami, cad
qu'il n'a pas le meme sens que le mot Francais. Le 'pair' en question
se traduit par 'even' en Anglais et 'odd' pour impair. C'est tres
simple a retenir en Anglais puisque 'even' est nombre pair de lettre
et 'odd' est un nombre impair. Pour plus de details sur la
signification de pair en Anglais:
http://en.wiktionary.org/wiki/pair
A+
I'm glad you explained that Riad. I was trying to guess what Nour meant, and
hadn't realised that "pair" mean "even" in French (my high school French never
required me to know that, or if it did, it's long forgotten).

Andrew.
 
I'm glad you explained that Riad. I was trying to guess what Nour meant, and
hadn't realised that "pair" mean "even" in French (my high school French never
required me to know that, or if it did, it's long forgotten).

Andrew.
Hi Andrew,
It was rather an excuse to have a bit of escape from the forum and
enjoying myself in scripting few words in French. Your French is
actually not that bad since you've managed to understand the above;
I'm not surprised at all ;-). I'm happy this helped anyway !
Cheers,
Riad.
 

Welcome to EDABoard.com

Sponsor

Back
Top