substitute MODULO predicate 
Author Message
 substitute MODULO predicate

Folks,

I'm stuck with using a version of prolog that has NO modulo (integer
division returning remainder) predicate. I REALLY need one. Does
anyone know where I can get one?

Thanks,
Greg.



Wed, 02 Jun 2004 01:19:10 GMT  
 substitute MODULO predicate

Quote:

> Folks,

> I'm stuck with using a version of prolog that has NO modulo (integer
> division returning remainder) predicate. I REALLY need one. Does
> anyone know where I can get one?

If your prolog don't have mod (as in  X is 1000 mod 7 ),
you can try:
   M is A - (A//B)*B.
where // is the integer divide.

if you don't have //, use floor(), as in:
   M is A - floor(A/B)*B.

--
Pascal



Mon, 07 Jun 2004 15:18:12 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. R4RS and modulo (was: need help understanding modulo)

2. Predicates that create new predicates.

3. Modulo 7 validation in ASM

4. Shift a "modulo" area

5. How to modulo in Haskell?

6. modulo/remainder: it's all division

7. Modulo operator

8. Modulo operator

9. modulo and remainder

10. need help understanding modulo

11. Division Modulo Problem

12. Modulo Operation

 

 
Powered by phpBB® Forum Software