<commit_before>﻿using System;

namespace ChamberLib
{
    public static class MathHelper
    {
        public static int RoundToInt(this float x)
        {
            return (int)Math.Round(x);
        }

        public static float ToRadians(this float degrees)
        {
            return degrees * 0.01745329251994f; // pi / 180
        }

        public static float ToDegrees( this float radians)
        {
            return radians * 57.2957795130823f; // 180 / pi
        }

        public static float Clamp(this float value, float min, float max)
        {
            return Math.Max(Math.Min(value, max), min);
        }
    }
}
<commit_msg>Replace Xna's Clamp method with our own.<commit_after>﻿using System;

namespace ChamberLib
{
    public static class MathHelper
    {
        public static int RoundToInt(this float x)
        {
            return (int)Math.Round(x);
        }

        public static float ToRadians(this float degrees)
        {
            return degrees * 0.01745329251994f; // pi / 180
        }

        public static float ToDegrees( this float radians)
        {
            return radians * 57.2957795130823f; // 180 / pi
        }

        public static float Clamp(this float value, float min, float max)
        {
            if (value > max)
                return max;

            if (value < min)
                return min;

            return value;
        }
    }
}

{'fraction_non_alphanumeric': 0.07730147575544624, 'fraction_numerical': 0.050597329585382995, 'mean_word_length': 1.5519713261648747, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2192246', 'n_tokens_mistral': 455, 'n_tokens_neox': 391, 'n_words': 120}