Skip to content

Conversation

@sstadick
Copy link
Contributor

Previously this was subtracting the negative score from the v_pos_limit, which is more negative than needed.

def main():
    var neg_score: UInt8 = 10
    var max_score: UInt8 = 5
    var checkpoint = min(UInt8.MAX - neg_score, UInt8.MAX - max_score)

    var new_score = 1 - neg_score
    print("Score underflow", new_score)
    if new_score >= checkpoint:
        print("saturation risk")

    new_score = 250 + max_score
    if new_score >= checkpoint:
        print("saturation risk")
    print("Score max", new_score)

@sstadick sstadick merged commit 51db415 into main May 28, 2025
@sstadick sstadick deleted the fix/saturation_check branch May 28, 2025 21:16
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.

2 participants