sealed
class
Rational
A ratio of two integers (e.g 2/3).
public
Rational
.Constructor(
int
wholenumber
,
int
numerator
=
null
,
int
denominator
=
null
)
public
static
Rational
Rational
.Convert(
value
)
Convert value into type Rational, null if not successful
public
virtual
object
.GetLayoutTip
Return a layout for the hint popup
public
virtual
object
.GetLayoutSpan
Return a layout inside a span
public
virtual
object
.GetLayoutBlock
Return a layout inside a block
public
virtual
object
.GetSourceReference
Return a source reference for this object
public
virtual
void
object
.GetTexSource(
source
)
LaTeX source code for this object
public
virtual
Icon
object
.GetIcon
Return a icon for this object
public
virtual
int
object
.Compare(
value
)
Compares this object with another and returns (-1, 0, or 1)
Example
=
Block
{
"One third =
{0}
"
(1
over
3);
"Two and five-sixths =
{0}
"
(
new
Rational
(2, 5, 6));
var
x
=
5
over
6
+
1
over
3;
x
;
Paragraph
{
TextDiagonal
:
true
;
x
;
}
};
One third =
1
3
Two and five-sixths =
2
5
6
1
1
6
1
1
6