Anonymous user
Define a primitive data type: Difference between revisions
→{{header|Elena}}
Line 472:
</lang>
=={{header|Elena}}==
ELENA 3.4:
<lang elena>import extensions.
sealed struct TinyInt :: BaseNumber
{
int
constructor(int n)
[
if ((n <= 1)||(n >= 10))
Line 487 ⟶ 488:
].
]
[
if ((
[
InvalidArgumentException new; raise
]
]
=
=
▲ tiny multiply(TinyInt t)
▲ = theValue + t int.
▲ tiny divide(TinyInt t)
▲ = theValue + t int.
bool equal(TinyInt t)
=
bool less(TinyInt t)
=
}
[
▲ tiny j := i + i.
try(
{
on(InvalidArgumentException e)
Line 537 ⟶ 532:
]
}.
]
=={{header|Euphoria}}==
|