cyclic definition with 'ans'

Bug #129443 reported by Alberto Simões
2
Affects Status Importance Assigned to Milestone
NumExp Core
Fix Committed
High
David Boucher

Bug Description

::> 4451+11340
ans = 15791
::> 170.07*ln[ans]
ans = 170.06999999999999 * ln[ans]
::> ans

oops ;)

Basically, variables should not be replaced UNLESS it is the 'ans' variable ;)

Revision history for this message
David Boucher (bouda1) wrote :

I'm not at home before wednesday so I can't see the problem (no linux box here), and there is something I don't understand.

You say "variables should not be replaced UNLESS it is the 'ans' variable" but I'm not agree.

If ans=15791, 170.07*ln[ans] should return at less (since we are here in simplification mode) 170.07*ln[15791]
and so, no recursive assignment !! And more, since a part of the expression is a floating point number, we can evaluate the all expression.

Could you tell me what's happening with the following example ?

::> z=4451+11340
::> z=170.07*ln[z]
::> z
Do you have the same "oops", an error with a "recursive assignment" or the good result ?

Thanks.

Changed in numexp-core:
assignee: nobody → bouda1
importance: Undecided → High
Revision history for this message
Alberto Simões (ambs) wrote : Re: [Bug 129443] Re: cyclic definition with 'ans'

Hi, David.

::> z=4451+11340
ans = 15791
::> z=170.07*ln[z]
IDL:Numexp/EvalError:1.0: recursive assignment

And, yes, I agree that we can evaluate 170.07*ln[anything] as 170.07 is
already a rational number.

CHeers
Alberto

David Boucher wrote:
> I'm not at home before wednesday so I can't see the problem (no linux
> box here), and there is something I don't understand.
>
> You say "variables should not be replaced UNLESS it is the 'ans'
> variable" but I'm not agree.
>
> If ans=15791, 170.07*ln[ans] should return at less (since we are here in simplification mode) 170.07*ln[15791]
> and so, no recursive assignment !! And more, since a part of the expression is a floating point number, we can evaluate the all expression.
>
> Could you tell me what's happening with the following example ?
>
> ::> z=4451+11340
> ::> z=170.07*ln[z]
> ::> z
> Do you have the same "oops", an error with a "recursive assignment" or the good result ?
>
> Thanks.
>
> ** Changed in: numexp-core (upstream)
> Importance: Undecided => High
> Assignee: (unassigned) => David Boucher
>

--
Alberto Simões - Departamento de Informática - Universidade do Minho
                  Campus de Gualtar - 4710-057 Braga - Portugal

   If you have the technical capability to complain about the docs,
   you have the technical ability to improve those docs.

David Boucher (bouda1)
Changed in numexp-core:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.