Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/serde_json/src/lexical/   (Fast Lexical Analyzer Version 2.6©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  shift.rs

  Sprache: Rust
 

// Adapted from https://github.com/Alexhuszagh/rust-lexical.

//! Bit-shift helpers.

use super::float::ExtendedFloat;
use core::mem;

// Shift extended-precision float right `shift` bytes.
#[inline]
pub(cratefn shr(fp: &mut ExtendedFloat, shift: i32) {
    let bits: u64 = mem::size_of::<u64>() as u64 * 8;
    debug_assert!((shift as u64) < bits, "shr() overflow in shift right.");

    fp.mant >>= shift;
    fp.exp += shift;
}

// Shift extended-precision float right `shift` bytes.
//
// Accepts when the shift is the same as the type size, and
// sets the value to 0.
#[inline]
pub(cratefn overflowing_shr(fp: &mut ExtendedFloat, shift: i32) {
    let bits: u64 = mem::size_of::<u64>() as u64 * 8;
    debug_assert!(
        (shift as u64) <= bits,
        "overflowing_shr() overflow in shift right."
    );

    fp.mant = if shift as u64 == bits {
        0
    } else {
        fp.mant >> shift
    };
    fp.exp += shift;
}

// Shift extended-precision float left `shift` bytes.
#[inline]
pub(cratefn shl(fp: &mut ExtendedFloat, shift: i32) {
    let bits: u64 = mem::size_of::<u64>() as u64 * 8;
    debug_assert!((shift as u64) < bits, "shl() overflow in shift left.");

    fp.mant <<= shift;
    fp.exp -= shift;
}

Messung V0.5 in Prozent
C=87 H=95 G=90

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-06-23) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.