Question: IF statement with units

Dear helpfull community. I stumbled over a problem which I cloud not sort out even after hours of trying to find the error I do. 
A simple IF statement does not work when I attach a unit to a value.

tt := 80*Unit('knot');
if tt < 100*Unit('knot') then
    lprint(got*it);
end if;

Surprisingly Maple can evalue the expression if a use a = instead of the <. File should be attached.

Please can anyone tell me what I did wrong.

NULL`~`[unassign](`<,>`(anames(user)))

with(LinearAlgebra); with(Optimization); Restart

NULLNULL

NULL

Problem 1 ( If Statement with units)

 

The if statement could not evealuated with the logical operator < or > when a unit is attached to the value

 

tt := 80*Unit('knot'); if tt < 100*Unit('knot') then lprint(got*it) end if

Error, cannot determine if this expression is true or false: 100*Units:-Unit(knot) < 80*Units:-Unit(knot)

 

 

 

But it works if the logical operator " = "

 

tt := 80*Unit('knot'); if tt = 80*Unit('knot') then lprint(got*it) end if

got*it

 

 

Anyone an idea why.

``

 

 

NULL

 

 

NULL

NULL

Download Problem_IF.mw

Please Wait...