CAS: Handling of Boolean

hawe shared this problem 1 year ago
Not a Problem

I'm trying to develop a function that reduces a matrix by one row/column.

So I go by sequence thru Element(Matrix) and want to add 1 if column/row counter >= kill row/column.


Kill(Mi,ki):=Sequence(Sequence( Element(Mi, j+if(j>=ki,1,0) , i+if(i>=ki,1,0)  ),i,1,length(Element(Mi, j))-1), j,1,Length(Mi)-((ki<=Length(Mi))*1)*1)


I tried to get rid of the if clause if(i>=ki,1,0) and if(j>=ki,1,0)

I was used to convert boolean by multiplication with 1, what I found


1: true*1=1

2: false*1=0

3: k:=3

4: (k==3)*1 = 1

5: (k>=3)*1 = true

6: ((k≥3)*1)*1 = 1

7: ((k<3)*1) = false

8: ((k<3)*1)*1 ) 0


should not be treated consistently?

Comments (1)

photo
1

Sorry, I don't think we'll change that

© 2020 International GeoGebra Institute