Skip to content

FLIP 357: Add Comparison Functions to Cadence#358

Open
turbolent wants to merge 4 commits intomainfrom
bastian/cadence-minof-maxof-functions
Open

FLIP 357: Add Comparison Functions to Cadence#358
turbolent wants to merge 4 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

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

Comments