Difference between revisions of "Template:Interval/doc"

From blackwiki
Jump to navigation Jump to search
imported>MSGJ
(create)
 
imported>MSGJ
(→‎Usage: examples)
Line 3: Line 3:
  
 
=== Usage ===
 
=== Usage ===
 +
This template determines which interval a given value lies in.
 +
 +
The intervals are defined by up to 4 unnamed parameters. The value to be determined is named parameter ''n''.
 +
 +
=== Examples ===
 +
Passing 2, 4 and 6 as the unnamed parmeters defines the following intervals:
 +
* x<2
 +
* 2≤x<4
 +
* 4≤x<6
 +
* 6≤x
 +
 +
Then:
 +
*{{tlx|Interval|2=n=4|3=2|4=4|5=6}} gives {{Interval|n=4|2|4|6}} because 4 is in the interval between the 2nd and 3rd values.
 +
*{{tlx|Interval|2=n=5|3=2|4=4|5=6}} gives {{Interval|n=5|2|4|6}} because 5 is in the interval between the 2nd and 3rd values.
 +
*{{tlx|Interval|2=n=6|3=2|4=4|5=6}} gives {{Interval|n=6|2|4|6}} because 6 is in the interval between the 3rd and 4th values.
  
 
=== See also ===
 
=== See also ===

Revision as of 15:39, 28 October 2010

Usage

This template determines which interval a given value lies in.

The intervals are defined by up to 4 unnamed parameters. The value to be determined is named parameter n.

Examples

Passing 2, 4 and 6 as the unnamed parmeters defines the following intervals:

  • x<2
  • 2≤x<4
  • 4≤x<6
  • 6≤x

Then:

  • {{Interval|n=4|2|4|6}} gives 2-3 because 4 is in the interval between the 2nd and 3rd values.
  • {{Interval|n=5|2|4|6}} gives 2-3 because 5 is in the interval between the 2nd and 3rd values.
  • {{Interval|n=6|2|4|6}} gives 3-4 because 6 is in the interval between the 3rd and 4th values.

See also