# Struct ibig::IBig[−][src]

`pub struct IBig { /* fields omitted */ }`

Signed big integer.

Arbitrarily large signed integer.

# Examples

```let a = ibig!(a2a123bbb127779cccc123123ccc base 32);
let b = ibig!(-0x1231abcd4134);
assert_eq!(a, c);
assert_eq!(b, d);```

## Implementations

### `impl IBig`[src]

#### `pub fn trailing_zeros(&self) -> Option<usize>`[src]

Returns the number of trailing zeros in the two’s complement binary representation.

In other words, it is the smallest `n` such that 2 to the power of `n` divides the number.

For 0, it returns `None`.

# Examples

```assert_eq!(ibig!(17).trailing_zeros(), Some(0));
assert_eq!(ibig!(-48).trailing_zeros(), Some(4));
assert_eq!(ibig!(-0b101000000).trailing_zeros(), Some(6));
assert_eq!(ibig!(0).trailing_zeros(), None);```

### `impl IBig`[src]

#### `pub fn to_f32(&self) -> f32`[src]

Convert to f32.

Round to nearest, breaking ties to even last bit.

# Examples

`assert_eq!(ibig!(-134).to_f32(), -134.0f32);`

#### `pub fn to_f64(&self) -> f64`[src]

Convert to f64.

Round to nearest, breaking ties to even last bit.

# Examples

`assert_eq!(ibig!(-134).to_f64(), -134.0f64);`

# Panics

Panics if `radix` is not between 2 and 36 inclusive.

# Examples

```assert_eq!(format!("{}", ibig!(-83).in_radix(3)), "-10002");

### `impl IBig`[src]

#### `pub fn from_str_radix(src: &str, radix: u32) -> Result<IBig, ParseError>`[src]

Convert a string in a given base to IBig.

The string may contain a `+` or `-` prefix. Digits 10-35 are represented by `a-z` or `A-Z`.

# Panics

Panics if `radix` is not between 2 and 36 inclusive.

# Examples

`assert_eq!(IBig::from_str_radix("-7ab", 32)?, ibig!(-7499));`

#### `pub fn from_str_with_radix_prefix(src: &str) -> Result<IBig, ParseError>`[src]

Convert a string with an optional radix prefix to IBig.

`src` may contain an ‘+’ or `-` prefix after the radix prefix.

Allowed prefixes: `0b` for binary, `0o` for octal, `0x` for hexadecimal.

# Examples

```assert_eq!(IBig::from_str_with_radix_prefix("+0o17")?, ibig!(0o17));

### `impl IBig`[src]

#### `pub fn pow(&self, exp: usize) -> IBig`[src]

Raises self to the power of `exp`.

# Example

`assert_eq!(ibig!(-3).pow(3), ibig!(-27));`

### `impl IBig`[src]

#### `pub fn signum(&self) -> IBig`[src]

A number representing the sign of `self`.

• -1 if the number is negative
• 0 if the number is zero
• 1 if the number is positive

# Examples

`assert_eq!(ibig!(-500).signum(), ibig!(-1));`

## Trait Implementations

### `impl Add<&'_ IBig> for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `+` operator.

### `impl Add<&'_ IBig> for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `+` operator.

### `impl Add<IBig> for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `+` operator.

### `impl Add<IBig> for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `+` operator.

### `impl BitAnd<&'_ IBig> for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `&` operator.

### `impl BitAnd<&'_ IBig> for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `&` operator.

### `impl BitAnd<IBig> for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `&` operator.

### `impl BitAnd<IBig> for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `&` operator.

### `impl BitOr<&'_ IBig> for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `|` operator.

### `impl BitOr<&'_ IBig> for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `|` operator.

### `impl BitOr<IBig> for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `|` operator.

### `impl BitOr<IBig> for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `|` operator.

### `impl BitXor<&'_ IBig> for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `^` operator.

### `impl BitXor<&'_ IBig> for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `^` operator.

### `impl BitXor<IBig> for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `^` operator.

### `impl BitXor<IBig> for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `^` operator.

### `impl Default for IBig`[src]

#### `fn default() -> IBig`[src]

Default value: 0.

### `impl Div<&'_ IBig> for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `/` operator.

### `impl Div<&'_ IBig> for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `/` operator.

### `impl Div<IBig> for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `/` operator.

### `impl Div<IBig> for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `/` operator.

### `impl FromStr for IBig`[src]

#### `type Err = ParseError`

The associated error which can be returned from parsing.

### `impl Mul<&'_ IBig> for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `*` operator.

### `impl Mul<&'_ IBig> for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `*` operator.

### `impl Mul<IBig> for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `*` operator.

### `impl Mul<IBig> for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `*` operator.

### `impl Neg for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `-` operator.

### `impl Neg for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `-` operator.

### `impl Not for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `!` operator.

### `impl Not for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `!` operator.

### `impl Pow<usize> for IBig`[src]

#### `type Output = IBig`

The result after applying the operator.

### `impl Pow<usize> for &IBig`[src]

#### `type Output = IBig`

The result after applying the operator.

### `impl Rem<&'_ IBig> for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `%` operator.

### `impl Rem<&'_ IBig> for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `%` operator.

### `impl Rem<IBig> for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `%` operator.

### `impl Rem<IBig> for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `%` operator.

### `impl SampleUniform for IBig`[src]

#### `type Sampler = UniformIBig`

The `UniformSampler` implementation supporting type `X`.

### `impl Shl<&'_ usize> for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `<<` operator.

### `impl Shl<&'_ usize> for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `<<` operator.

### `impl Shl<usize> for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `<<` operator.

### `impl Shl<usize> for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `<<` operator.

### `impl Shr<&'_ usize> for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `>>` operator.

### `impl Shr<&'_ usize> for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `>>` operator.

### `impl Shr<usize> for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `>>` operator.

### `impl Shr<usize> for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `>>` operator.

### `impl Sub<&'_ IBig> for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `-` operator.

### `impl Sub<&'_ IBig> for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `-` operator.

### `impl Sub<IBig> for IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `-` operator.

### `impl Sub<IBig> for &IBig`[src]

#### `type Output = IBig`

The resulting type after applying the `-` operator.

### `impl TryFrom<&'_ IBig> for UBig`[src]

#### `type Error = OutOfBoundsError`

The type returned in the event of a conversion error.

### `impl TryFrom<IBig> for UBig`[src]

#### `type Error = OutOfBoundsError`

The type returned in the event of a conversion error.

## Blanket Implementations

### `impl<T> ToOwned for T where    T: Clone, `[src]

#### `type Owned = T`

The resulting type after obtaining ownership.

### `impl<T, U> TryFrom<U> for T where    U: Into<T>, `[src]

#### `type Error = Infallible`

The type returned in the event of a conversion error.

### `impl<T, U> TryInto<U> for T where    U: TryFrom<T>, `[src]

#### `type Error = <U as TryFrom<T>>::Error`

The type returned in the event of a conversion error.