[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eFraction\u003c/code\u003e class represents a fraction with a numerator and a denominator, where the denominator must be positive.\u003c/p\u003e\n"],["\u003cp\u003eThis class inherits from \u003ccode\u003eobject\u003c/code\u003e and implements multiple interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable<Fraction>\u003c/code\u003e, \u003ccode\u003eIDeepCloneable<Fraction>\u003c/code\u003e, \u003ccode\u003eIBufferMessage\u003c/code\u003e, and \u003ccode\u003eIMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eFraction\u003c/code\u003e class provides constructors for creating instances, either default or by copying another \u003ccode\u003eFraction\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eIt has two key properties: \u003ccode\u003eNumerator\u003c/code\u003e and \u003ccode\u003eDenominator\u003c/code\u003e, both of which are of type \u003ccode\u003elong\u003c/code\u003e and represent the respective parts of the fraction.\u003c/p\u003e\n"],["\u003cp\u003eMethods are included for operations like calculating the size, cloning, comparing equality, merging, converting to a string, and writing to a coded output stream.\u003c/p\u003e\n"]]],[],null,["# Class Fraction (2.17.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.17.0 (latest)](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Type.Fraction)\n- [2.15.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.15.0/Google.Type.Fraction)\n- [2.10.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.10.0/Google.Type.Fraction)\n- [2.2.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.2.0/Google.Type.Fraction) \n\n public sealed class Fraction : IMessage\u003cFraction\u003e, IEquatable\u003cFraction\u003e, IDeepCloneable\u003cFraction\u003e, IBufferMessage, IMessage\n\nRepresents a fraction in terms of a numerator divided by a denominator. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Fraction \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Fraction](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Type.Fraction), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Fraction](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Type.Fraction), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Fraction](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Type.Fraction), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals)\n\nNamespace\n---------\n\n[Google.Type](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Type)\n\nAssembly\n--------\n\nGoogle.Api.CommonProtos.dll\n\nConstructors\n------------\n\n### Fraction()\n\n public Fraction()\n\n### Fraction(Fraction)\n\n public Fraction(Fraction other)\n\nFields\n------\n\n### DenominatorFieldNumber\n\n public const int DenominatorFieldNumber = 2\n\nField number for the \"denominator\" field.\n\n### NumeratorFieldNumber\n\n public const int NumeratorFieldNumber = 1\n\nField number for the \"numerator\" field.\n\nProperties\n----------\n\n### Denominator\n\n public long Denominator { get; set; }\n\nThe value by which the numerator is divided, e.g. 3 in 2/3. Must be\npositive.\n\n### Descriptor\n\n public static MessageDescriptor Descriptor { get; }\n\n### Numerator\n\n public long Numerator { get; set; }\n\nThe numerator in the fraction, e.g. 2 in 2/3.\n\n### Parser\n\n public static MessageParser\u003cFraction\u003e Parser { get; }\n\nMethods\n-------\n\n### CalculateSize()\n\n public int CalculateSize()\n\n### Clone()\n\n public Fraction Clone()\n\n### Equals(Fraction)\n\n public bool Equals(Fraction other)\n\n### Equals(object)\n\n public override bool Equals(object other)\n\n**Overrides** \n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object))\n\n### GetHashCode()\n\n public override int GetHashCode()\n\n**Overrides** \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)\n\n### MergeFrom(CodedInputStream)\n\n public void MergeFrom(CodedInputStream input)\n\n### MergeFrom(Fraction)\n\n public void MergeFrom(Fraction other)\n\n### ToString()\n\n public override string ToString()\n\n**Overrides** \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\n### WriteTo(CodedOutputStream)\n\n public void WriteTo(CodedOutputStream output)"]]