# [−][src]Module typenum::int

Type-level signed integers.

Type operators implemented:

From `core::ops`: `Add`, `Sub`, `Mul`, `Div`, and `Rem`. From `typenum`: `Same`, `Cmp`, and `Pow`.

Rather than directly using the structs defined in this module, it is recommended that you import and use the relevant aliases from the consts module.

Note that operators that work on the underlying structure of the number are intentionally not implemented. This is because this implementation of signed integers does not use twos-complement, and implementing them would require making arbitrary choices, causing the results of such operators to be difficult to reason about.

# Example

    use std::ops::{Add, Sub, Mul, Div, Rem};
    use typenum::{Integer, N3, P2};

    assert_eq!(<N3 as Add<P2>>::Output::to_i32(), -1);
    assert_eq!(<N3 as Sub<P2>>::Output::to_i32(), -5);
    assert_eq!(<N3 as Mul<P2>>::Output::to_i32(), -6);
    assert_eq!(<N3 as Div<P2>>::Output::to_i32(), -1);
    assert_eq!(<N3 as Rem<P2>>::Output::to_i32(), -1);

## Re-exports

`pub use marker_traits::Integer;`

## Structs

NInt | Type-level signed integers with negative sign.
PInt | Type-level signed integers with positive sign.
Z0 | The type-level signed integer 0.

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)