Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Makefloat::Float::integer_decode DRY#328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
mtilda wants to merge12 commits intorust-num:master
base:master
Choose a base branch
Loading
frommtilda:mtilda/enhance/float-integer-decode
Draft
Changes from1 commit
Commits
Show all changes
12 commits
Select commitHold shift + click to select a range
f4967af
Add unit tests for trait method `float::Float::integer_decode`
mtildaJun 27, 2024
25eb45f
Add FIXME related to NaN inputs to
mtildaJun 27, 2024
9232b28
Fix assertion message in `test_integer_decode`
mtildaJun 28, 2024
6d33cdb
Merge remote-tracking branch 'upstream/master' into mtilda/test/float…
mtildaJun 28, 2024
a6e2912
Update doc strings to clarify which numbers are recoverable
mtildaJun 28, 2024
300a7f9
Remove FIXME related to NaN inputs
mtildaJun 28, 2024
6309a53
Add test cases for subnormal inputs to `Float::integer_decode`
mtildaJun 28, 2024
c3b277a
Add comments to mantissa calculation
mtildaJun 28, 2024
3c09565
Refactor functions `integer_decode_f32` and `integer_decode_f64` with…
mtildaJun 27, 2024
32710c8
Remove debug print statements
mtildaJun 27, 2024
5477176
Rename and reorder macro parameters
mtildaJun 27, 2024
0a0a8e5
Fix bug causing subnormal test case to fail
mtildaJun 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Update doc strings to clarify which numbers are recoverable
  • Loading branch information
@mtilda
mtilda committedJun 28, 2024
commita6e2912fa817eb4f532fb21d881ab876ce22e4d2
4 changes: 4 additions & 0 deletionssrc/float.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -775,7 +775,9 @@ pub trait FloatCore: Num + NumCast + Neg<Output = Self> + PartialOrd + Copy {
fn to_radians(self) -> Self;

/// Returns the mantissa, base 2 exponent, and sign as integers, respectively.
///
/// The original number can be recovered by `sign * mantissa * 2 ^ exponent`.
/// This formula only works for zero, normal, and infinite numbers (per `classify()`)
///
/// # Examples
///
Expand DownExpand Up@@ -1861,7 +1863,9 @@ pub trait Float: Num + Copy + NumCast + PartialOrd + Neg<Output = Self> {
fn atanh(self) -> Self;

/// Returns the mantissa, base 2 exponent, and sign as integers, respectively.
///
/// The original number can be recovered by `sign * mantissa * 2 ^ exponent`.
/// This formula only works for zero, normal, and infinite numbers (per `classify()`)
///
/// ```
/// use num_traits::Float;
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp