Well I'm not really good at math :blush: so would anyone tell me what is the use of mod expression? What is it and when to use it?
Thanks in advance![]()









Well I'm not really good at math :blush: so would anyone tell me what is the use of mod expression? What is it and when to use it?
Thanks in advance![]()

a formal product of places of a number field









More clearly please?

http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=131092&gonew=1# UNREAD
MOD is used to get the remainder from a division of numbers. For example:
16 MOD 4 will return 0, as 4 can be divided into 16 exactly.
Whereas 17 MOD 4 will return 1 as the result.
Hope that makes sense.




Where does the mathematical concept of MOD come from? When I have used Modulus in maths at school Modulus = Absolute Value. It does not seem to be the same in programming in MMF. I have always wondered about that... even though I find MMF's Mod to be a super useful function.

In MMF we actually use 'Modulo' rather then 'Modular' arithmetic such as taught is schools...
They both give the same results but are calculated and displayed differently.
The original concepts of modular maths were conceived to allow for 12 hours clocks, hence modular arithmetic is often called 'Clock arithmetic'
ABS() is the function to return the absolute in mmf.
Hey NetNinja,
The concept of Mod was first put out completely by Guass in Disquisitiones Arithmeticae.
The idea is, you take the numbers {0,1,2,...,n-1} as representatives ([small]or you can work with equivalence classes if you like, it's not an issue[/small]) and work modulo n. i.e. you set a+b to be Mod[a+b,n] and so forth.
You then get the lovely fact that they work just like the integers, except for a small hitch with cancelling.
But even nicer, let n be prime. Then for any number i there exists another number j such that i*j = 1. That is, it has an inverse under multiplication. Thus it forms a finite field. Fields are particularly nice things. And finite things are particularly nice. Finite fields are not particularly nice things as odd things happen in them in Algebraic Geometry and Galois Theory.
Of course, everything that can be stated with modulo arithmetic can be stated without it, but it is such a nice concept and it really tidies things up.
'Modulus' means length hence the mix up. However, in mathematics 'modulus' is nearly always used to mean 'up to', as an abuse of language.




This is all bringing back happy memories of failing Advanced Higher maths.