|
From: Gunter K. <gu...@pe...> - 2014-09-29 17:39:38
|
Try using equals(y,0) as criterion of the comparison: "=" tests for structural equality and there are several ways of expressing zero. Kind regards, Gunter. On 29. September 2014 19:30:31 MESZ, Dimiter Prodanov <dim...@gm...> wrote: >Hello, > >I define a function > >dy(y):=if y#0 and y#0.0 then 1/(2*y) else 'nan; > >Then I wanted to substitute it's first argument by a value. The idea is >to >use pass a function having a variable number of arguments as a method >parameter and then to evaluate it only on certain arguments. > > >I stumbled on the following weird behavior: > >apply(dy, [y=0]); >expt: undefined: 0 to a negative exponent. > -- an error. > >also here > >at(dy(y),[y=0]); > >expt: undefined: 0 to a negative exponent. > -- an error. > >while dy(0) correctly evaluates to 'nan > >best regards, > >Dimiter > > >------------------------------------------------------------------------ > >------------------------------------------------------------------------------ >Slashdot TV. Videos for Nerds. Stuff that Matters. >http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk > >------------------------------------------------------------------------ > >_______________________________________________ >Maxima-discuss mailing list >Max...@li... >https://lists.sourceforge.net/lists/listinfo/maxima-discuss -- Diese Nachricht wurde von meinem Mobiltelefon mit Kaiten Mail gesendet. |