Replace ^ with <sup> html balise
This commit is contained in:
parent
5309a3e31d
commit
7a07a73eb1
3 changed files with 11 additions and 10 deletions
|
@ -1253,17 +1253,17 @@ extern "rust-intrinsic" {
|
||||||
#[cfg(not(stage0))]
|
#[cfg(not(stage0))]
|
||||||
pub fn unchecked_shr<T>(x: T, y: T) -> T;
|
pub fn unchecked_shr<T>(x: T, y: T) -> T;
|
||||||
|
|
||||||
/// Returns (a + b) mod 2^N, where N is the width of T in bits.
|
/// Returns (a + b) mod 2<sup>N</sup>, where N is the width of T in bits.
|
||||||
/// The stabilized versions of this intrinsic are available on the integer
|
/// The stabilized versions of this intrinsic are available on the integer
|
||||||
/// primitives via the `wrapping_add` method. For example,
|
/// primitives via the `wrapping_add` method. For example,
|
||||||
/// [`std::u32::wrapping_add`](../../std/primitive.u32.html#method.wrapping_add)
|
/// [`std::u32::wrapping_add`](../../std/primitive.u32.html#method.wrapping_add)
|
||||||
pub fn overflowing_add<T>(a: T, b: T) -> T;
|
pub fn overflowing_add<T>(a: T, b: T) -> T;
|
||||||
/// Returns (a - b) mod 2^N, where N is the width of T in bits.
|
/// Returns (a - b) mod 2<sup>N</sup>, where N is the width of T in bits.
|
||||||
/// The stabilized versions of this intrinsic are available on the integer
|
/// The stabilized versions of this intrinsic are available on the integer
|
||||||
/// primitives via the `wrapping_sub` method. For example,
|
/// primitives via the `wrapping_sub` method. For example,
|
||||||
/// [`std::u32::wrapping_sub`](../../std/primitive.u32.html#method.wrapping_sub)
|
/// [`std::u32::wrapping_sub`](../../std/primitive.u32.html#method.wrapping_sub)
|
||||||
pub fn overflowing_sub<T>(a: T, b: T) -> T;
|
pub fn overflowing_sub<T>(a: T, b: T) -> T;
|
||||||
/// Returns (a * b) mod 2^N, where N is the width of T in bits.
|
/// Returns (a * b) mod 2<sup>N</sup>, where N is the width of T in bits.
|
||||||
/// The stabilized versions of this intrinsic are available on the integer
|
/// The stabilized versions of this intrinsic are available on the integer
|
||||||
/// primitives via the `wrapping_mul` method. For example,
|
/// primitives via the `wrapping_mul` method. For example,
|
||||||
/// [`std::u32::wrapping_mul`](../../std/primitive.u32.html#method.wrapping_mul)
|
/// [`std::u32::wrapping_mul`](../../std/primitive.u32.html#method.wrapping_mul)
|
||||||
|
|
|
@ -10,12 +10,12 @@
|
||||||
|
|
||||||
//! Bit fiddling on positive IEEE 754 floats. Negative numbers aren't and needn't be handled.
|
//! Bit fiddling on positive IEEE 754 floats. Negative numbers aren't and needn't be handled.
|
||||||
//! Normal floating point numbers have a canonical representation as (frac, exp) such that the
|
//! Normal floating point numbers have a canonical representation as (frac, exp) such that the
|
||||||
//! value is 2^exp * (1 + sum(frac[N-i] / 2^i)) where N is the number of bits. Subnormals are
|
//! value is 2<sup>exp</sup> * (1 + sum(frac[N-i] / 2<sup>i</sup>)) where N is the number of bits.
|
||||||
//! slightly different and weird, but the same principle applies.
|
//! Subnormals are slightly different and weird, but the same principle applies.
|
||||||
//!
|
//!
|
||||||
//! Here, however, we represent them as (sig, k) with f positive, such that the value is f * 2^e.
|
//! Here, however, we represent them as (sig, k) with f positive, such that the value is f *
|
||||||
//! Besides making the "hidden bit" explicit, this changes the exponent by the so-called
|
//! 2<sup>e</sup>. Besides making the "hidden bit" explicit, this changes the exponent by the
|
||||||
//! mantissa shift.
|
//! so-called mantissa shift.
|
||||||
//!
|
//!
|
||||||
//! Put another way, normally floats are written as (1) but here they are written as (2):
|
//! Put another way, normally floats are written as (1) but here they are written as (2):
|
||||||
//!
|
//!
|
||||||
|
@ -94,7 +94,8 @@ pub trait RawFloat : Float + Copy + Debug + LowerExp
|
||||||
/// represented, the other code in this module makes sure to never let that happen.
|
/// represented, the other code in this module makes sure to never let that happen.
|
||||||
fn from_int(x: u64) -> Self;
|
fn from_int(x: u64) -> Self;
|
||||||
|
|
||||||
/// Get the value 10^e from a pre-computed table. Panics for e >= ceil_log5_of_max_sig().
|
/// Get the value 10<sup>e</sup> from a pre-computed table. Panics for e >=
|
||||||
|
/// ceil_log5_of_max_sig().
|
||||||
fn short_fast_pow10(e: usize) -> Self;
|
fn short_fast_pow10(e: usize) -> Self;
|
||||||
|
|
||||||
// FIXME Everything that follows should be associated constants, but taking the value of an
|
// FIXME Everything that follows should be associated constants, but taking the value of an
|
||||||
|
|
|
@ -267,7 +267,7 @@ impl Size {
|
||||||
|
|
||||||
/// Alignment of a type in bytes, both ABI-mandated and preferred.
|
/// Alignment of a type in bytes, both ABI-mandated and preferred.
|
||||||
/// Since alignments are always powers of 2, we can pack both in one byte,
|
/// Since alignments are always powers of 2, we can pack both in one byte,
|
||||||
/// giving each a nibble (4 bits) for a maximum alignment of 2^15 = 32768.
|
/// giving each a nibble (4 bits) for a maximum alignment of 2<sup>15</sup> = 32768.
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
|
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
|
||||||
pub struct Align {
|
pub struct Align {
|
||||||
raw: u8
|
raw: u8
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue