Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 1ff94d5

Browse files
committed
simplify exp
1 parent 3289b05 commit 1ff94d5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

etc/update-api-list.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
functions are covered by our macros.
44
"""
55

6+
# TOOD: also match with `${name}_any_suffix` so we pick up `fma_big`.
7+
68
import difflib
79
import json
810
import subprocess as sp

src/math/generic/fma.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use super::super::fenv::{
22
FE_INEXACT, FE_TONEAREST, FE_UNDERFLOW, feclearexcept, fegetround, feraiseexcept, fetestexcept,
33
};
4-
use super::super::{CastFrom, CastInto, DFloat, Float, HFloat, IntTy, MinInt};
4+
use super::super::{CastFrom, CastInto, DFloat, Float, HFloat, Int, IntTy, MinInt};
55

66
/// FMA implementation when a hardware-backed larger float type is available.
77
pub fn fma_big<F, B>(x: F, y: F, z: F) -> F
@@ -23,7 +23,7 @@ where
2323
xy = x.widen() * y.widen();
2424
result = xy + z.widen();
2525
ui = result.to_bits();
26-
e = i32::cast_from(ui >> F::SIG_BITS) & F::EXP_MAX as i32;
26+
e = result.exp().signed();
2727
let zb: B = z.widen();
2828

2929
let prec_diff = B::SIG_BITS - F::SIG_BITS;

0 commit comments

Comments
 (0)