From f344de5258d67dbb9854ba776998ceae22853051 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 4 Oct 2020 19:34:37 +0100 Subject: [PATCH] fixes to bigfloat Signed-off-by: Ian Jackson --- src/bigfloat.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/bigfloat.rs b/src/bigfloat.rs index 2a44bf03..e1a58ee1 100644 --- a/src/bigfloat.rs +++ b/src/bigfloat.rs @@ -1,10 +1,5 @@ // See bigfloat.ts -#![allow(unused_variables)] -#![allow(dead_code)] -#![allow(unused_mut)] -#![allow(unused_imports)] - use crate::imports::*; enum Sign { Pos, Neg, } @@ -39,6 +34,7 @@ mod innards { } #[repr(C)] + #[allow(dead_code)] // this is for documentation purposes struct Repr { h: Header, limbs: [Limb], @@ -86,6 +82,7 @@ mod innards { } } + #[allow(dead_code)] // xxx pub(in super) fn as_mut_limbs(&self) -> (&Header, &mut [Limb]) { unsafe { @@ -162,7 +159,7 @@ impl Bigfloat { '!' => Neg, _ => None?, }; - let exp = p.hex16(); + let exp = p.hex16()?; let mut limbs = Vec::with_capacity(p.0.len() / CHARS_PER_LIMB); loop { @@ -178,7 +175,7 @@ impl Bigfloat { ]); } if limbs.is_empty() { None? } - Bigfloat::from_parts(sign, 0, &limbs) + Bigfloat::from_parts(sign, exp, &limbs) } fn to_string(&self) -> String { -- 2.30.2