Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Simple maths using n=n#

Author
Message
Tim Ballisto
21
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Right behind you.
Posted: 16th Apr 2004 22:08
Find whether a number is prime or composite.


Find whether a number is even or odd.


Find whether or not a number is whole.


Because of DB's floating point math, these are only accurate up to six figures.


Programs for programmers.
ifman1
21
Years of Service
User Offline
Joined: 3rd Jul 2003
Location:
Posted: 17th Apr 2004 03:22
Here's some alternate code for the Prime, using the lesser known and hardly documented MOD statement. There are some guys on the forum that were nice enough to point this function out to me, so I thought I'd pass it along.



And here's another option for the even or odd, also using the MOD function


They don't use your n# theme, but it's effective. I don't think I can duplicate your whole number function using the MOD function. I wasn't trying to steal your thread or anything, just thought I'd show an alternate way to get the same results, this is one of the reasons I love programming!

DBPro's made out of PEOPLE.... PEOPLE.......!!!!!

Login to post a reply

Server time is: 2025-05-13 13:11:49
Your offset time is: 2025-05-13 13:11:49