# num_traits::float::FloatConst - Rust
API documentation for the Rust `FloatConst` trait in crate `num_traits`.
Keywords: rust, rustlang, rust-lang, FloatConst

# [−] [src] Trait num_traits::float::FloatConst

    pub trait FloatConst {
        fn E() -> Self;
        fn FRAC_1_PI() -> Self;
        fn FRAC_1_SQRT_2() -> Self;
        fn FRAC_2_PI() -> Self;
        fn FRAC_2_SQRT_PI() -> Self;
        fn FRAC_PI_2() -> Self;
        fn FRAC_PI_3() -> Self;
        fn FRAC_PI_4() -> Self;
        fn FRAC_PI_6() -> Self;
        fn FRAC_PI_8() -> Self;
        fn LN_10() -> Self;
        fn LN_2() -> Self;
        fn LOG10_E() -> Self;
        fn LOG2_E() -> Self;
        fn PI() -> Self;
        fn SQRT_2() -> Self;
    }

## Required methods

### `fn E() -> Self`

Return Euler’s number.

### `fn FRAC_1_PI() -> Self`

Return `1.0 / π`.

### `fn FRAC_1_SQRT_2() -> Self`

Return `1.0 / sqrt(2.0)`.

### `fn FRAC_2_PI() -> Self`

Return `2.0 / π`.

### `fn FRAC_2_SQRT_PI() -> Self`

Return `2.0 / sqrt(π)`.

### `fn FRAC_PI_2() -> Self`

Return `π / 2.0`.

### `fn FRAC_PI_3() -> Self`

Return `π / 3.0`.

### `fn FRAC_PI_4() -> Self`

Return `π / 4.0`.

### `fn FRAC_PI_6() -> Self`

Return `π / 6.0`.

### `fn FRAC_PI_8() -> Self`

Return `π / 8.0`.

### `fn LN_10() -> Self`

Return `ln(10.0)`.

### `fn LN_2() -> Self`

Return `ln(2.0)`.

### `fn LOG10_E() -> Self`

Return `log10(e)`.

### `fn LOG2_E() -> Self`

Return `log2(e)`.

### `fn PI() -> Self`

Return Archimedes’ constant.

### `fn SQRT_2() -> Self`

Return `sqrt(2.0)`.

Loading content...

## Implementations on Foreign Types

### `impl FloatConst for f32` [src]

#### `fn E() -> Self` [src]

#### `fn FRAC_1_PI() -> Self` [src]

#### `fn FRAC_1_SQRT_2() -> Self` [src]

#### `fn FRAC_2_PI() -> Self` [src]

#### `fn FRAC_2_SQRT_PI() -> Self` [src]

#### `fn FRAC_PI_2() -> Self` [src]

#### `fn FRAC_PI_3() -> Self` [src]

#### `fn FRAC_PI_4() -> Self` [src]

#### `fn FRAC_PI_6() -> Self` [src]

#### `fn FRAC_PI_8() -> Self` [src]

#### `fn LN_10() -> Self` [src]

#### `fn LN_2() -> Self` [src]

#### `fn LOG10_E() -> Self` [src]

#### `fn LOG2_E() -> Self` [src]

#### `fn PI() -> Self` [src]

#### `fn SQRT_2() -> Self` [src]

### `impl FloatConst for f64` [src]

#### `fn E() -> Self` [src]

#### `fn FRAC_1_PI() -> Self` [src]

#### `fn FRAC_1_SQRT_2() -> Self` [src]

#### `fn FRAC_2_PI() -> Self` [src]

#### `fn FRAC_2_SQRT_PI() -> Self` [src]

#### `fn FRAC_PI_2() -> Self` [src]

#### `fn FRAC_PI_3() -> Self` [src]

#### `fn FRAC_PI_4() -> Self` [src]

#### `fn FRAC_PI_6() -> Self` [src]

#### `fn FRAC_PI_8() -> Self` [src]

#### `fn LN_10() -> Self` [src]

#### `fn LN_2() -> Self` [src]

#### `fn LOG10_E() -> Self` [src]

#### `fn LOG2_E() -> Self` [src]

#### `fn PI() -> Self` [src]

#### `fn SQRT_2() -> Self` [src]

Loading content...

## Implementors

Loading content...

# 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`)