<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace DecimalConsole
{
    public struct RealDecimal
    {
        public static RealDecimal Zero { get; } = default(RealDecimal);

        public URealDecimal AbsoluteValue { get; }
        public bool? IsPositive { get; }

        public int? Degree => AbsoluteValue.Degree;
        public bool IsZero => AbsoluteValue.IsZero;

        public byte this[int index] => AbsoluteValue[index];

        internal RealDecimal(URealDecimal absoluteValue, bool? isPositive)
        {
            if (absoluteValue.IsZero ^ !isPositive.HasValue) throw new ArgumentException("");

            AbsoluteValue = absoluteValue;
            IsPositive = isPositive;
        }

        public override string ToString()
        {
            return base.ToString();
        }
    }
}<commit_msg>Implement implicit operators<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace DecimalConsole
{
    public struct RealDecimal
    {
        public static RealDecimal Zero { get; } = default(RealDecimal);

        public URealDecimal AbsoluteValue { get; }
        public bool? IsPositive { get; }

        public int? Degree => AbsoluteValue.Degree;
        public bool IsZero => AbsoluteValue.IsZero;

        public byte this[int index] => AbsoluteValue[index];

        internal RealDecimal(URealDecimal absoluteValue, bool? isPositive)
        {
            if (absoluteValue.IsZero ^ !isPositive.HasValue) throw new ArgumentException("");

            AbsoluteValue = absoluteValue;
            IsPositive = isPositive;
        }

        public override string ToString() =>
            $"{(IsPositive == false ? "-" : "")}{AbsoluteValue}";

        static RealDecimal FromString(string value)
        {
            var hasMinus = value?.StartsWith("-") ?? throw new ArgumentNullException();
            URealDecimal ud = value.TrimStart('-');
            var isPositive = ud.IsZero ? default(bool?) : !hasMinus;

            return new RealDecimal(ud, isPositive);
        }

        static RealDecimal FromInt32(int value) => value.ToString();
        static RealDecimal FromDouble(double value) => value.ToString();

        public static implicit operator RealDecimal(string value) => FromString(value);
        public static implicit operator RealDecimal(int value) => FromInt32(value);
        public static implicit operator RealDecimal(double value) => FromDouble(value);
    }
}
{'fraction_non_alphanumeric': 0.09428685577307232, 'fraction_numerical': 0.0015980823012385138, 'mean_word_length': 2.6823529411764704, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '1354564', 'n_tokens_mistral': 650, 'n_tokens_neox': 609, 'n_words': 174}