I don't mean that the operator name has to be INT2RAT as in my subject line, but I wonder if it would be possible for such an operator to be included in, say, OperatorsMath.d (or even supplied as built-in).
I ran into this requirement when I was trying to compare some real students' real exam scores with the computed average (you see, I do use Rel for "real" as well as for teaching!). The scores are values of type INTEGER whereas AVG(score) yields a value of type RATIONAL.
Hugh
request for INT2RAT conversion operator
Re: request for INT2RAT conversion operator
CAST_AS_RATIONAL is a built-in operator. E.g.:
The sys.OperatorsBuiltin relvar contains signatures for most of the built-in operators.
Code: Select all
CAST_AS_RATIONAL(2)
2.0
-
- Posts: 124
- Joined: Sat May 24, 2008 4:49 pm
Re: request for INT2RAT conversion operator
Oops! Sorry to have bothered you. A case of RTFM I suppose.
Chastened,
Hugh
Chastened,
Hugh
Re: request for INT2RAT conversion operator
No bother at all! I have to admit I'd forgotten the name of the operator and had to look it up.
This also gives me the opportunity to point out that built-in operators also appear in the sys.Operators relvar. sys.OperatorsBuiltin contains built-in operators not associated with any particular TYPE definition. sys.Operators contains, by default, operators specifically generated by and associated with the built-in TYPE definitions.
This also gives me the opportunity to point out that built-in operators also appear in the sys.Operators relvar. sys.OperatorsBuiltin contains built-in operators not associated with any particular TYPE definition. sys.Operators contains, by default, operators specifically generated by and associated with the built-in TYPE definitions.