move use/const statements to a limited scope
This commit is contained in:
parent
47d6a214d4
commit
887fca89c2
2 changed files with 6 additions and 5 deletions
|
|
@ -77,9 +77,6 @@
|
|||
*/
|
||||
|
||||
use core::f64;
|
||||
use core::num::Wrapping;
|
||||
|
||||
const TINY: f64 = 1.0e-300;
|
||||
|
||||
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
|
||||
pub fn sqrt(x: f64) -> f64 {
|
||||
|
|
@ -112,6 +109,10 @@ pub fn sqrt(x: f64) -> f64 {
|
|||
}
|
||||
#[cfg(not(target_feature = "sse2"))]
|
||||
{
|
||||
use core::num::Wrapping;
|
||||
|
||||
const TINY: f64 = 1.0e-300;
|
||||
|
||||
let mut z: f64;
|
||||
let sign: Wrapping<u32> = Wrapping(0x80000000);
|
||||
let mut ix0: i32;
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@
|
|||
* ====================================================
|
||||
*/
|
||||
|
||||
const TINY: f32 = 1.0e-30;
|
||||
|
||||
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
|
||||
pub fn sqrtf(x: f32) -> f32 {
|
||||
// On wasm32 we know that LLVM's intrinsic will compile to an optimized
|
||||
|
|
@ -46,6 +44,8 @@ pub fn sqrtf(x: f32) -> f32 {
|
|||
}
|
||||
#[cfg(not(target_feature = "sse"))]
|
||||
{
|
||||
const TINY: f32 = 1.0e-30;
|
||||
|
||||
let mut z: f32;
|
||||
let sign: i32 = 0x80000000u32 as i32;
|
||||
let mut ix: i32;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue