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 / modulo division emulation

Author
Message
bytemonkey
21
Years of Service
User Offline
Joined: 30th Oct 2003
Location:
Posted: 31st Oct 2003 17:56
i didn't find such modulo dividison in DBPro or a DLL what is written in C like this

0 % 4 = 0
1 % 4 = 1
2 % 4 = 1
3 % 4 = 1
4 % 4 = 0
5 % 4 = 1
6 % 4 = 1
7 % 4 = 1
8 % 4 = 0
9 % 4 = 1
10 % 4 = 1
11 % 4 = 1
12 % 4 = 0
13 % 4 = 1
14 % 4 = 1
bytemonkey
21
Years of Service
User Offline
Joined: 30th Oct 2003
Location:
Posted: 31st Oct 2003 17:58
heartbone
22
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 31st Oct 2003 18:10
Although not keyword highlighted in the editor,
try this program:

Print 23 Mod 7
Wait Key

DBP does indeed have the modulo function.

The more you see, the more you know.
The more you know, the more you see.
Codger
22
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 31st Oct 2003 22:39
I am no longer current on C but

14 mod 4 = 2 not 1

System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX
bytemonkey
21
Years of Service
User Offline
Joined: 30th Oct 2003
Location:
Posted: 31st Oct 2003 22:58
@heartbone cool thx i was seeking so long for this it's surley a faster thing

@codger on the real mod it should be 5 from 3.5
the routine i wrote was only to check for example every 4th number and so, so the result of 0 or 1 is the mostly important point

Login to post a reply

Server time is: 2024-11-23 23:51:43
Your offset time is: 2024-11-23 23:51:43