Post Reply 
Ranks calculation
11-01-2024, 10:34 AM (This post was last modified: 11-01-2024 11:14 AM by Albert Chan.)
Post: #13
RE: Ranks calculation
(11-01-2024 10:03 AM)robmio Wrote:  the code generates Index outside range error.

I mean when we do equality test, Index outside range not producing error

Cas> m := [1,2,3]
Cas> m[3] == m[4]      → 0
Cas> m[4] == m[5]      → 0
Cas> m[5] == m[6]      → 0

m2[hi][1]==m2[hi+1][1] guard should also generate 0, i.e. always update last ranking.

If we use this undefined behavior (not recommended), we can drop ii≠hi guard.

Interestingly, I discovered this due to a typo , i≠hi instead of ii≠hi
Since i = √(-1) is imaginary, i≠hi is always true, same as no guard.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Ranks calculation - robmio - 10-31-2024, 01:39 PM
RE: Ranks calculation - Albert Chan - 10-31-2024, 02:38 PM
RE: Ranks calculation - robmio - 10-31-2024, 02:46 PM
RE: Ranks calculation - robmio - 10-31-2024, 02:50 PM
RE: Ranks calculation - Albert Chan - 10-31-2024, 04:41 PM
RE: Ranks calculation - robmio - 10-31-2024, 08:16 PM
RE: Ranks calculation - Albert Chan - 10-31-2024, 08:42 PM
RE: Ranks calculation - robmio - 11-01-2024, 07:41 AM
RE: Ranks calculation - robmio - 11-01-2024, 09:04 AM
RE: Ranks calculation - Albert Chan - 11-01-2024, 09:38 AM
RE: Ranks calculation - robmio - 11-01-2024, 10:03 AM
RE: Ranks calculation - Albert Chan - 11-01-2024 10:34 AM
RE: Ranks calculation - robmio - 11-01-2024, 10:04 AM



User(s) browsing this thread: 3 Guest(s)