### The curious case of OPERATOR ABS(INTEGER).

Posted:

**Sun Dec 31, 2017 3:37 am**I've been meaning to bring this to your attention for some time so here it is. There is an easy workaround

but if you are unaware of this problem it can cause serious grief

Running Relv3.010 on WINDOWS 10.

It would seem ABS(INTEGER) always incorrectly displays a rational but is correctly recognized as an integer.

But then there is this confusion.

thanks,

but if you are unaware of this problem it can cause serious grief

Running Relv3.010 on WINDOWS 10.

It would seem ABS(INTEGER) always incorrectly displays a rational but is correctly recognized as an integer.

Code: Select all

```
WRITELN ABS(14) ; //14.0
WRITELN ABS(7); //7.0
WRITELN ABS(-5) ; //5.0
WRITELN ABS ( (-15*2)/5); //6.0
WRITELN TYPE_OF(ABS(1)); //Scalar("INTEGER")
WRITELN TYPE_OF(ABS(-1)); //Scalar("INTEGER")
WRITELN REL{TUP{X1 ABS(4), X2 4.0},TUP{X1 ABS(-5), X2 -5.0}} ;
/*
RELATION {X1 INTEGER, X2 RATIONAL} {
TUPLE {X1 4.0, X2 4.0},
TUPLE {X1 5.0, X2 -5.0}
*/
```

Code: Select all

```
WRITELN ABS(-5)*2 ; //ERROR: RS0278: No run-time invocation targets found for OP_TIMES(RATIONAL, INTEGER) RETURNS INTEGER
WRITELN TYPE_OF ( ABS(-5)*2 ) ; //Scalar("INTEGER")
WRITELN TYPE_OF ( ABS(-5)*2.0 ) ; //ERROR: RS0055: Could not find operator OP_TIMES(INTEGER, RATIONAL) RETURNS RATIONAL
```