Share to:

Skabelon:Mod/dok


Brug
Denne skabelon beregner det matematiske udtryk modulus, dvs. den heltallige rest fra en fuldstændig division af en reel dividend med en modulus, som ikke er nul. Den returnerede værdi er altid nul eller af samme fortegn som modulussen, og dens absolutte værdi er altid mindre end værdien af modulus.
Iøvrigt returnerer denne skabelon værdien af dividenden selv, hvis modulus er nul (eftersom skabelonen aldrig må returnere fejl pga. division med nul).
Syntaks
{{Mod|1=dividend|2=modulus}}
Eksempler med en heltallig og positiv modulus
  • {{Mod|12|10}} = "2".
  • {{Mod|10.1|10}} = "0.1".
  • {{Mod|10|10}} = "0".
  • {{Mod|2|10}} = "2".
  • {{Mod|0|10}} = "0".
  • {{Mod|-2|10}} = "8".
  • {{Mod|-10|10}} = "0".
  • {{Mod|-10.1|10}} = "9.9".
  • {{Mod|-12|10}} = "8".
Eksempler med en heltallig og negativ modulus
  • {{Mod|12|-10}} = "-8".
  • {{Mod|10.1|-10}} = "0.1".
  • {{Mod|10|-10}} = "0".
  • {{Mod|2|-10}} = "-8".
  • {{Mod|0|-10}} = "0".
  • {{Mod|-2|-10}} = "-2".
  • {{Mod|-10|-10}} = "0".
  • {{Mod|-10.1|-10}} = "-0.1".
  • {{Mod|-12|-10}} = "-2".
Eksempler med en ikke-heltallig, positiv modulus
  • {{Mod|21.5|10.5}} = "0.5".
  • {{Mod|21.1|10.5}} = "0.1".
  • {{Mod|21|10.5}} = "0".
  • {{Mod|20.9|10.5}} = "10.4".
  • {{Mod|11|10.5}} = "0.5".
  • {{Mod|10.6|10.5}} = "0.1".
  • {{Mod|10.5|10.5}} = "0".
  • {{Mod|10.1|10.5}} = "10.1".
  • {{Mod|10|10.5}} = "10".
  • {{Mod|2|10.5}} = "2".
  • {{Mod|0|10.5}} = "0".
  • {{Mod|-2|10.5}} = "8.5".
  • {{Mod|-10|10.5}} = "0.5".
  • {{Mod|-10.1|10.5}} = "0.4".
  • {{Mod|-10.5|10.5}} = "0".
  • {{Mod|-10.6|10.5}} = "10.4".
  • {{Mod|-11|10.5}} = "10".
  • {{Mod|-20.9|10.5}} = "0.1".
  • {{Mod|-21|10.5}} = "0".
  • {{Mod|-21.1|10.5}} = "10.4".
  • {{Mod|-21.5|10.5}} = "10".
Eksempler med modulus nul
  • {{Mod|2|0}} = "2".
  • {{Mod|0|0}} = "0".
  • {{Mod|-2|0}} = "-2".
Se også

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.
Prefix: a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9

Portal di Ensiklopedia Dunia

Kembali kehalaman sebelumnya