Skip to content

FLIP 357: Add Comparison Functions to Cadence#358

Merged
turbolent merged 5 commits intomainfrom
bastian/cadence-minof-maxof-functions
Mar 10, 2026
Merged

FLIP 357: Add Comparison Functions to Cadence#358
turbolent merged 5 commits intomainfrom
bastian/cadence-minof-maxof-functions

Conversation

@turbolent
Copy link
Member

Work towards #357

Copy link
Member

@SupunS SupunS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@bluesign
Copy link
Collaborator

yeah this is much needed. I love it. ( I would also love clamp(value, min, max) )

Copy link
Member

@joshuahannan joshuahannan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will be great to have!

@turbolent turbolent changed the title FLIP 357: Add minOf and maxOf Functions to Cadence FLIP 357: Add Comparison Functions to Cadence Feb 17, 2026
@turbolent
Copy link
Member Author

I've updated the proposal in a8a2a4d:

  • Renamed the functions to min/max, so they have familiar names, like in most other languages
  • Define the functions in the new contract Comparison, instead globally. This avoids any naming conflicts and guarantees backward compatibility for existing code

@turbolent
Copy link
Member Author

Added a clamp function in c05e5f4. cc @bluesign

@turbolent
Copy link
Member Author

There has been no negative feedback, this FLIP has been accepted

@turbolent turbolent merged commit e6a5de8 into main Mar 10, 2026
@turbolent turbolent deleted the bastian/cadence-minof-maxof-functions branch March 10, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants