Google BigQuery v2 API - Struct BigQueryBigNumeric (3.7.0)

public struct BigQueryBigNumeric : IEquatable<BigQueryBigNumeric>, IComparable<BigQueryBigNumeric>, IComparable

Reference documentation and code samples for the Google BigQuery v2 API struct BigQueryBigNumeric.

Representation of the BigQuery BIGNUMERIC type, which has 76 digits of precision (plus a leftmost partial digit), and a fixed scale of 38 decimal places to the right of the decimal point. This is the same as to say that the type supports 38 full digits and a partial 39th digit before the decimal point and 38 digits after the decimal point. The supported value range is exactly -2^255e-38 to (2^255 - 1)e-38.

Namespace

Google.Cloud.BigQuery.V2

Assembly

Google.Cloud.BigQuery.V2.dll

Properties

Epsilon

public static BigQueryBigNumeric Epsilon { get; }

The smallest positive value for BigQueryBigNumeric, equal to 1e-38.

Property Value
TypeDescription
BigQueryBigNumeric

MaxValue

public static BigQueryBigNumeric MaxValue { get; }

The maximum valid value for BigQueryBigNumeric, equal to (2^255 - 1)e-38.

Property Value
TypeDescription
BigQueryBigNumeric

MinValue

public static BigQueryBigNumeric MinValue { get; }

The minimum valid value for BigQueryBigNumeric, equal to -2^255e-38.

Property Value
TypeDescription
BigQueryBigNumeric

Zero

public static BigQueryBigNumeric Zero { get; }

Zero represented as a BigQueryBigNumeric. This is the default value for the type.

Property Value
TypeDescription
BigQueryBigNumeric

Methods

CompareTo(BigQueryBigNumeric)

public int CompareTo(BigQueryBigNumeric other)

Compares this value with other.

Parameter
NameDescription
otherBigQueryBigNumeric

The value to compare with this one

Returns
TypeDescription
int

A negative integer if this value is less than other; a positive integer if it's greater than other; zero if they're equal.

GetHashCode()

public override int GetHashCode()

Returns a hash code for this value.

Returns
TypeDescription
int

A hash code for this value.

Overrides

Parse(string)

public static BigQueryBigNumeric Parse(string text)

Parses a textual representation as a BigQueryBigNumeric.

Parameter
NameDescription
textstring

The text to parse. Must not be null.

Returns
TypeDescription
BigQueryBigNumeric

The parsed value.

Remarks

text must be a representation of a decimal value which can be represented by BigQueryBigNumeric, using "." as a decimal place where one is specified, and a leading "-" for negative values. Leading zeroes and insignificant trailing digits are permitted.

Exceptions
TypeDescription
FormatException

The value could not be parsed as a BigQueryBigNumeric.

ToDecimal(LossOfPrecisionHandling)

public decimal ToDecimal(LossOfPrecisionHandling lossOfPrecisionHandling)

Converts this value to BigQueryBigNumeric,

Parameter
NameDescription
lossOfPrecisionHandlingLossOfPrecisionHandling

How to handle values with signficant digits that would be lost by the conversion.

Returns
TypeDescription
decimal

The converted value.

Remarks

This conversion may silently lose precision, depending on lossOfPrecisionHandling, but will always throw OverflowException if value is out of the range of decimal.

Exceptions
TypeDescription
OverflowException

This value is outside the range of decimal.

ToString()

public override string ToString()

Returns a canonical string representation of this value. This always uses "." as a decimal point, and only includes as many decimal places as are required to completely represent the value. If the value is between -1 and 1 exclusive, a "0" character is included before the decimal point.

Returns
TypeDescription
string

A canonical string representation of this value.

Overrides

TryParse(string, out BigQueryBigNumeric)

public static bool TryParse(string text, out BigQueryBigNumeric value)

Attempts to parse a textual representation of a BigQueryBigNumeric value.

Parameters
NameDescription
textstring

The text to parse. Must not be null.

valueBigQueryBigNumeric

The parsed value, or 0 on failure.

Returns
TypeDescription
bool

true if text was parsed successfully; false otherwise.

Remarks

See Parse(string) for format details. This method will return true if and only if Parse(string) would return without an exception.

Operators

operator +(BigQueryBigNumeric, BigQueryBigNumeric)

public static BigQueryBigNumeric operator +(BigQueryBigNumeric lhs, BigQueryBigNumeric rhs)

Returns the result of adding two BigQueryBigNumeric values together.

Parameters
NameDescription
lhsBigQueryBigNumeric

The first value to add.

rhsBigQueryBigNumeric

The second value to add.

Returns
TypeDescription
BigQueryBigNumeric

The result of adding the two values.

operator ==(BigQueryBigNumeric, BigQueryBigNumeric)

public static bool operator ==(BigQueryBigNumeric lhs, BigQueryBigNumeric rhs)

Compares two values for equality.

Parameters
NameDescription
lhsBigQueryBigNumeric

The first value to compare.

rhsBigQueryBigNumeric

The second value to compare.

Returns
TypeDescription
bool

true if the two arguments are equal; false otherwise.

explicit operator decimal(BigQueryBigNumeric)

public static explicit operator decimal(BigQueryBigNumeric value)

Explicit conversion from BigQueryBigNumeric to decimal.

Parameter
NameDescription
valueBigQueryBigNumeric

The numeric value to convert.

Returns
TypeDescription
decimal

The result of the conversion.

Remarks

This conversion may silently lose precision, but will throw OverflowException if the value is out of range of decimal. Use ToDecimal(LossOfPrecisionHandling) passing in Throw for the second argument to avoid any information loss.

implicit operator BigQueryBigNumeric(decimal)

public static implicit operator BigQueryBigNumeric(decimal value)

Explicit conversion from decimal to BigQueryBigNumeric. This conversion never loses precision.

Parameter
NameDescription
valuedecimal

The decimal value to convert.

Returns
TypeDescription
BigQueryBigNumeric

The result of the conversion.

implicit operator BigQueryBigNumeric(int)

public static implicit operator BigQueryBigNumeric(int value)

Implicit conversion from int to BigQueryBigNumeric.

Parameter
NameDescription
valueint

The integer value to convert.

Returns
TypeDescription
BigQueryBigNumeric

The result of the conversion.

Remarks

This conversion exists to avoid ambiguity between the 64-bit conversions when using an integer literal.

implicit operator BigQueryBigNumeric(long)

public static implicit operator BigQueryBigNumeric(long value)

Implicit conversion from long to BigQueryBigNumeric.

Parameter
NameDescription
valuelong

The integer value to convert.

Returns
TypeDescription
BigQueryBigNumeric

The result of the conversion.

implicit operator BigQueryBigNumeric(ulong)

public static implicit operator BigQueryBigNumeric(ulong value)

Implicit conversion from ulong to BigQueryBigNumeric.

Parameter
NameDescription
valueulong

The integer value to convert.

Returns
TypeDescription
BigQueryBigNumeric

The result of the conversion.

operator !=(BigQueryBigNumeric, BigQueryBigNumeric)

public static bool operator !=(BigQueryBigNumeric lhs, BigQueryBigNumeric rhs)

Compares two values for inequality.

Parameters
NameDescription
lhsBigQueryBigNumeric

The first value to compare.

rhsBigQueryBigNumeric

The second value to compare.

Returns
TypeDescription
bool

false if the two arguments are equal; true otherwise.

operator -(BigQueryBigNumeric, BigQueryBigNumeric)

public static BigQueryBigNumeric operator -(BigQueryBigNumeric lhs, BigQueryBigNumeric rhs)

Returns the result of subtracting one BigQueryBigNumeric value from another.

Parameters
NameDescription
lhsBigQueryBigNumeric

The value to subtract from.

rhsBigQueryBigNumeric

The value to subtract.

Returns
TypeDescription
BigQueryBigNumeric

The result of subtracting rhs from lhs.

operator -(BigQueryBigNumeric)

public static BigQueryBigNumeric operator -(BigQueryBigNumeric value)

The unary negation operator.

Parameter
NameDescription
valueBigQueryBigNumeric

The value to negate.

Returns
TypeDescription
BigQueryBigNumeric

The negation of value.

operator +(BigQueryBigNumeric)

public static BigQueryBigNumeric operator +(BigQueryBigNumeric value)

The unary plus operator, provided mainly for consistency.

Parameter
NameDescription
valueBigQueryBigNumeric

The value to return.

Returns
TypeDescription
BigQueryBigNumeric

The original value.