octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: symbolic true


From: Doug Stewart
Subject: Re: symbolic true
Date: Thu, 11 Jun 2015 06:24:08 -0400



On Thu, Jun 11, 2015 at 4:19 AM, Colin Macdonald <address@hidden> wrote:
On 11/06/15 04:05, Doug Stewart wrote:
using this code:


clear
syms p a b
digits(47);

  b=vpa("1.00000")
  a=vpa("3.90000")
  b<a
  a<b

   if ( b<a)
    p="100"
   else
    p="400"
   endif

After running this p should be 100 but it isn't.

The if statement always goes to the false condition!!

How can I make the if statement work with a
(sym) True

Currently, you need `if (logical (b < a))`

This is a bug in Octave: https://savannah.gnu.org/bugs/?43097

(also noted here: https://github.com/cbm755/octsympy/issues/191)

FWIW, the decision to have symbolic True/False values in Symbolic pkg could be revisited which would be a workaround.  But I think I did that to avoid corner cases like
`[x true x]`.

Colin


thanks

--
DASCertificate for 206392


reply via email to

[Prev in Thread] Current Thread [Next in Thread]