# Fraction struct

Namespace: [Grasshopper2.Types.Numeric](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.types.numeric.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
[IoId("00000000-DF18-4DBC-951A-94ACCDF1B835")]
public struct Fraction : IStorable
```

Represents a fraction.

## Constructors

- [Fraction](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/ctor.md): (2 overloads) Create a new fraction from numerator and denominator.

## Properties

- [Denominator](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/denominator.md): Gets the denominator of this fraction.
- [IsNegative](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/isnegative.md): Gets whether this fraction is negative.
- [IsPositive](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/ispositive.md): Gets whether this fraction is negative.
- [IsUndefined](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/isundefined.md): Gets whether this fraction is undefined (i.e. whether the denominator is zero).
- [IsZero](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/iszero.md): Gets whether this fraction has been initialised.
- [Magnitude](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/magnitude.md): Gets the magnitude or integral part of this fraction. If the fraction is negative, the integral part will be more positive than the fraction value.
- [MinusOne](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/minusone.md): (static) Gets the default negative unit value.
- [Numerator](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/numerator.md): Gets the numerator of this fraction.
- [One](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/one.md): (static) Gets the default positive unit value.
- [Partial](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/partial.md): Gets the partial part of this fraction. That is, the part after subtracting the magnitude.
- [Unset](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/unset.md): (static) Gets the default zero value.
- [Zero](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/zero.md): (static) Gets the default zero value.

## Methods

- [Absolute](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/absolute.md): Gets the absolute value of this fraction.
- [Equals](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/equals.md): Indicates whether this instance and a specified object are equal.
- [GetHashCode](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/gethashcode.md): Returns the hash code for this instance.
- [Mean](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/mean.md): (static) Compute the mean (or average) of two fractions.
- [Mediant](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/mediant.md): (static) Compute the mediant of two fractions.
- [Rationalise](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/rationalise.md): (2 overloads, static) Find a fraction which well describes this double.
- [RationalMediants](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/rationalmediants.md): (static) Re-implementation of Eric Lippert's dedoublifier algorithm at: https://ericlippert.com/2015/12/10/the-dedoublifier-part-four/
- [Reduce](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/reduce.md): Reduce this fraction by reducing the numerator and denominator by the greatest common denominator.
- [Store](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/store.md)
- [ToDouble](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/todouble.md): Get the double represented by this fraction.
- [ToString](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/tostring.md): (2 overloads) Gets the string representation of this fraction.

## Operators

- [operator +](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/op-addition.md): (static) Add two fractions. The result is not necessarily in reduced form, as that may be a very slow operation.
- [operator /](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/op-division.md): (static) Divide two fractions. The result is not necessarily in reduced form, as that may be a very slow operation.
- [operator ==](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/op-equality.md): (static) Compare two fractions. Equality is defined numerically, not structurally. Undefined fractions are always unequal.
- [operator >](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/op-greaterthan.md): (static) Compare two fractions.
- [operator >=](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/op-greaterthanorequal.md): (static) Compare two fractions.
- [operator !=](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/op-inequality.md): (static) Compare two fractions. Inequality is defined numerically, not structurally. Undefined fractions are always unequal.
- [operator <](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/op-lessthan.md): (static) Compare two fractions.
- [operator <=](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/op-lessthanorequal.md): (static) Compare two fractions.
- [operator *](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/op-multiply.md): (static) Multiply two fractions. The result is not necessarily in reduced form, as that may be a very slow operation.
- [operator -](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/op-subtraction.md): (static) Subtract two fractions. The result is not necessarily in reduced form, as that may be a very slow operation.

## Convertors

- [operator implicit](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.numeric.fraction/op-implicit.md): (4 overloads, static) Auto convert a fraction to a double.
