Re: Mupad: Plot problem "Can't evaluate to boolean"



Marten wrote:

d_f:=(f,k,g)->(if d_h(f,k)>(g-f) then g*d_h(f,k)/(d_h(f,k)-(g-f*10^-3))
else infinity end_if):
...

d_f(50,5.6,100) results in infinity like coded in the if statment
above.

But when I try the following plot It won't work. But why?

p56f:=plot::Function3d(d_f(f,5.6,g),f=10..300,g=0.01..1000):
Error: Can't evaluate to boolean [_less];
during evaluation of 'd_f'

Because your code does not handle the call “d_f(f,5.6,g)” which you have given. This is not really something about plotting. You get the same error message from just typing “d_f(f,5.6,g)“. Try
p56f:=plot::Function3d(hold(d_f(f,5.6,g)),f=10..300,g=0.01..1000)
instead.



regards, Christopher Creutzig (who starts thinking if it would break anything to include an implicit hold() at this place, since the problem keeps confusing users) .



Relevant Pages

  • Re: Exexcute Method
    ... >My reasoning centres around the fact that a while statement's loop control ... >expression is of type Boolean, and Flag is already a Boolean. ... If FailDoSomething(Cnst, Cnst, AVar) Then ... to ensure that evaluation is left to right ...
    (comp.lang.pascal.delphi.misc)
  • Re: EXPRESSION EVALUATION
    ... No, the Boolean version is ... > logic to short-circuit the evaluation in the first case, ...
    (comp.lang.pl1)
  • Re: unusual OR syntax
    ... should be considered essential knowledge for a programmer. ... Constructing logic using short-circuit evaluation tends to be a lot more compact, and I can easily see the advantages of that. ... Functions return a value that will be evaluated as a boolean when used like this. ... The right hand expressions is NOT evaluated when the left hand expression evaluated to true in case of OR. ...
    (comp.lang.php)
  • Re: Exception error with date/time (Access 2000)
    ... Datediff returns a number, not a boolean. ... vbscript does not do short-circuit evaluation. ... This email account is my spam trap so I ...
    (microsoft.public.inetserver.asp.db)
  • Re: Operationalize orthogonality
    ... Equijoin is fundamental; non-equijoin is not. ... This is why boolean is the only mandatory type - equality is defined as ... "they can hand off evaluation of the comparisons to operators you've ...
    (comp.databases.theory)