dbTalk Databases Forums  

Mod function question

comp.databases.filemaker comp.databases.filemaker


Discuss Mod function question in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
tomstreet@arkcda.org
 
Posts: n/a

Default Mod function question - 10-24-2005 , 11:46 AM






I have a series of numbers from 1.001 to 1.999. I need to determine
which are odd and which are even. I understand the Mod function does
this but so far I've not been able to get it to work on the numbers to
the right of the decimal point. Is there some other route I need to
pursue?

TIA
Tom Street


Reply With Quote
  #2  
Old   
Bill Marriott
 
Posts: n/a

Default Re: Mod function question - 10-24-2005 , 12:47 PM






By definition, an odd number is an integer not evenly divisible by 2. So
technically, all of the values are odd.

I am guessing you want to know the numbers, in which the fractional part
ends in an even number.

In this case, why not multiply by 1000 first?

Mod ( n * 1000; 2)

equals 1 in the case of an "Odd" number, 0 in the case of an even one.

Bill

<tomstreet (AT) arkcda (DOT) org> wrote

Quote:
I have a series of numbers from 1.001 to 1.999. I need to determine
which are odd and which are even. I understand the Mod function does
this but so far I've not been able to get it to work on the numbers to
the right of the decimal point. Is there some other route I need to
pursue?

TIA
Tom Street




Reply With Quote
  #3  
Old   
42
 
Posts: n/a

Default Re: Mod function question - 10-24-2005 , 12:48 PM



In article <1130172384.774281.242340 (AT) g49g2000cwa (DOT) googlegroups.com>,
tomstreet (AT) arkcda (DOT) org says...
Quote:
I have a series of numbers from 1.001 to 1.999. I need to determine
which are odd and which are even. I understand the Mod function does
this but so far I've not been able to get it to work on the numbers to
the right of the decimal point. Is there some other route I need to
pursue?
Uh... the terms odd and even are only defined on integers. No numbers
between 1.001 and 1.999 are odd or even.

Multiply your number by 1000 to make them integers.

-cheers,
Dave


Reply With Quote
  #4  
Old   
42
 
Posts: n/a

Default Re: Mod function question - 10-24-2005 , 01:23 PM



Just being pedantic here...

In article <kcKdna_oyO6og8DeRVn-pA (AT) comcast (DOT) com>, wjm (AT) wjm (DOT) org says...
Quote:
By definition, an odd number is an integer not evenly divisible by 2.
Yes!

Quote:
So technically, all of the values are odd.
No!

An odd number is an *integer*; these aren't integers, therefore they
can't be odd (or even for that matter).

-cheers
Dave


Reply With Quote
  #5  
Old   
Bill Marriott
 
Posts: n/a

Default Re: Mod function question - 10-24-2005 , 04:20 PM



Right. The things I notice after I click Send

"42" <nospam (AT) nospam (DOT) com> wrote

Quote:
Just being pedantic here...

In article <kcKdna_oyO6og8DeRVn-pA (AT) comcast (DOT) com>, wjm (AT) wjm (DOT) org says...
By definition, an odd number is an integer not evenly divisible by 2.

Yes!

So technically, all of the values are odd.

No!

An odd number is an *integer*; these aren't integers, therefore they
can't be odd (or even for that matter).

-cheers
Dave



Reply With Quote
  #6  
Old   
tomstreet@arkcda.org
 
Posts: n/a

Default Re: Mod function question - 10-24-2005 , 04:37 PM



I've learned something today. My mathematically challenged mind thought
that an even number was any number divisible by 2 and not any INTEGER.
Your suggestion works fine. Many thanks.

Tom Street


Reply With Quote
  #7  
Old   
Bill Marriott
 
Posts: n/a

Default Re: Mod function question - 10-25-2005 , 12:00 AM



But no fraction is evenly divisible by 2

<tomstreet (AT) arkcda (DOT) org> wrote

Quote:
I've learned something today. My mathematically challenged mind thought
that an even number was any number divisible by 2 and not any INTEGER.
Your suggestion works fine. Many thanks.

Tom Street




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.