Jump to content

User:Σ/Testing facility/Factor/doc

From Wikipedia, the free encyclopedia

This template finds if a number is a factor of another number. Use it like this:

{{User:Σ/Testing facility/Factor|number to factor|divisor|then=then string (optional, default: 1)|else=else string (optional, default: 0)}}

Examples:

  • {{User:Σ/Testing facility/Factor|10|5}} gives 1
  • {{User:Σ/Testing facility/Factor|20|11}} gives 0
  • {{User:Σ/Testing facility/Factor|4|2|then="true"|else="false"}} gives "true"
  • {{User:Σ/Testing facility/Factor|4|3|then='THREVEN'|else='THRODD'}} gives 'THRODD'
  • {{User:Σ/Testing facility/Factor|20|2|then=EVEN|else=ODD}} gives EVEN