Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
2 changes: 0 additions & 2 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: CMake

on:
push:
branches-ignore:
- main
pull_request:
branches: [ main ]

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Code Coverage

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch: # Manual trigger
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

#### 2026-02-26 - dfloat (IEEE 754-2008 Decimal FP) and hfloat (IBM System/360 Hex FP)

- **dfloat: IEEE 754-2008 decimal floating-point** (`dfloat<ndigits, es, Encoding, bt>`):
- Complete implementation with both BID (Binary Integer Decimal) and DPD (Densely Packed Decimal) encodings via `DecimalEncoding` enum template parameter
- IEEE 754-2008 combination field encode/decode (5-bit field discriminating MSD 0-7 vs 8-9 vs inf/NaN)
- Arithmetic operations (+, -, *, /) using `__uint128_t` wide intermediates for precision
- DPD codec with canonical IEEE 754-2008 Table 3.3 truth table — all 1000 encode/decode round-trips verified
- Standard aliases: `decimal32`, `decimal64`, `decimal128` (BID) and `decimal32_dpd`, `decimal64_dpd`, `decimal128_dpd` (DPD)
- Math library (all functions delegating through double), numeric_limits (radix=10), traits
- Regression tests: assignment/conversion, comparison operators, addition, subtraction, multiplication, division, decimal32 standard format, DPD codec exhaustive verification (17 tests total across dfloat+hfloat)

- **hfloat: IBM System/360 hexadecimal floating-point** (`hfloat<ndigits, es, bt>`):
- Classic 1964-era HFP: base-16 exponent, no hidden bit, no NaN, no infinity, no subnormals
- Truncation rounding only (never rounds up), overflow saturates to maxpos/maxneg
- Wobbling precision: 0-3 leading zero bits in MSB hex digit
- Standard aliases: `hfloat_short` (32-bit), `hfloat_long` (64-bit), `hfloat_extended` (128-bit)
- Math library, numeric_limits (radix=16, has_infinity=false, has_quiet_NaN=false), traits
- Regression tests: assignment/conversion, comparison operators, addition, subtraction, multiplication, division, short precision standard format

- Both types pass `ReportTrivialityOfType` (trivially constructible/copyable) and compile with zero warnings on both gcc and clang

### Fixed

#### 2026-02-26 - Issue Triage, Clang/Android Binary128, and Posit CLI Precision
Expand Down
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if(NOT DEFINED UNIVERSAL_VERSION_MAJOR)
set(UNIVERSAL_VERSION_MAJOR 3)
endif()
if(NOT DEFINED UNIVERSAL_VERSION_MINOR)
set(UNIVERSAL_VERSION_MINOR 103)
set(UNIVERSAL_VERSION_MINOR 104)
endif()
if(NOT DEFINED UNIVERSAL_VERSION_PATCH)
set(UNIVERSAL_VERSION_PATCH 1)
Expand Down Expand Up @@ -165,6 +165,7 @@ option(UNIVERSAL_BUILD_NUMBER_FIXPNTS "Set to ON to build static fi
option(UNIVERSAL_BUILD_NUMBER_BFLOATS "Set to ON to build static bfloat tests" OFF)
option(UNIVERSAL_BUILD_NUMBER_CFLOATS "Set to ON to build static cfloat tests" OFF)
option(UNIVERSAL_BUILD_NUMBER_DFLOATS "Set to ON to build static dfloat tests" OFF)
option(UNIVERSAL_BUILD_NUMBER_HFLOATS "Set to ON to build static hfloat tests" OFF)
option(UNIVERSAL_BUILD_NUMBER_DOUBLE_DOUBLE "Set to ON to build static dd tests" OFF)
option(UNIVERSAL_BUILD_NUMBER_QUAD_DOUBLE "Set to ON to build static qd tests" OFF)
option(UNIVERSAL_BUILD_NUMBER_DD_CASCADE "Set to ON to build static dd cascade tests" OFF)
Expand Down Expand Up @@ -800,6 +801,7 @@ if(UNIVERSAL_BUILD_NUMBER_STATICS)
set(UNIVERSAL_BUILD_NUMBER_BFLOATS ON)
set(UNIVERSAL_BUILD_NUMBER_CFLOATS ON)
set(UNIVERSAL_BUILD_NUMBER_DFLOATS ON)
set(UNIVERSAL_BUILD_NUMBER_HFLOATS ON)
set(UNIVERSAL_BUILD_NUMBER_DOUBLE_DOUBLE ON)
set(UNIVERSAL_BUILD_NUMBER_QUAD_DOUBLE ON)
set(UNIVERSAL_BUILD_NUMBER_DD_CASCADE ON)
Expand Down Expand Up @@ -1025,6 +1027,11 @@ if(UNIVERSAL_BUILD_NUMBER_DFLOATS)
add_subdirectory("static/float/dfloat")
endif(UNIVERSAL_BUILD_NUMBER_DFLOATS)

# hexadecimal floats (IBM System/360)
if(UNIVERSAL_BUILD_NUMBER_HFLOATS)
add_subdirectory("static/float/hfloat")
endif(UNIVERSAL_BUILD_NUMBER_HFLOATS)

# double-double floats
if(UNIVERSAL_BUILD_NUMBER_DOUBLE_DOUBLE)
add_subdirectory("static/highprecision/dd")
Expand Down
123 changes: 123 additions & 0 deletions docs/sessions/2026-02-26_dfloat_hfloat_implementation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Session: dfloat (IEEE 754-2008 Decimal FP) and hfloat (IBM System/360 Hex FP)

**Date:** 2026-02-26
**Branch:** `v3.104`
**Build directories:** `build_dfloat/` (gcc), `build_clang_dfloat/` (clang)

## Objective

Implement two new number systems completing the floating-point radix family: `dfloat` (IEEE 754-2008 decimal floating-point with BID and DPD encodings) and `hfloat` (IBM System/360 hexadecimal floating-point). IBM mainframes historically provided all three in hardware: binary (IEEE 754), hexadecimal (System/360, 1964), and decimal (financial industry). Adding these serves as an educational resource for comparing encoding tradeoffs.

## Changes Made (2 commits on v3.104)

### 1. `c618d701` — Implement dfloat and hfloat core infrastructure, arithmetic, math libraries

**49 files changed, 4082 insertions(+), 534 deletions(-)**

#### dfloat: IEEE 754-2008 Decimal Floating-Point

**Design:** Template `dfloat<ndigits, es, Encoding, bt>` with `DecimalEncoding` enum `{BID, DPD}`. Both encodings in one type for educational comparison.

**Storage layout:** `[sign(1)] [combination(5)] [exponent_continuation(w)] [trailing_significand(t)]`

| Alias | Config | Bits |
|-------|--------|------|
| decimal32 | `dfloat<7, 6, BID>` | 1+5+6+20 = 32 |
| decimal64 | `dfloat<16, 8, BID>` | 1+5+8+50 = 64 |
| decimal128 | `dfloat<34, 12, BID>` | 1+5+12+110 = 128 |

**Key implementation details:**
- `nbits` computed via constexpr `bid_trailing_bits()` using integer approximation `ceil(n * log2(10)) = ceil(n * 3322 / 1000)` — avoids non-constexpr `std::ceil/std::log2`
- Combination field: `ab!=11` → exp_msbs=ab, MSD=0cde; `ab==11,c!=1` → exp_msbs=cd, MSD=100e; `11110`=inf; `11111`=NaN
- Addition aligns by scaling UP the larger-exponent operand (not dividing down smaller — prevents precision loss)
- Multiplication/division use `__uint128_t` for wide intermediate results
- DPD branches via `if constexpr (encoding == DecimalEncoding::DPD)` in significand pack/unpack
- DPD codec: canonical IEEE 754-2008 Table 3.3 truth table with 8-case encode/decode, all 1000 round-trips verified

**Files modified:**
- `dfloat_fwd.hpp` — Added `DecimalEncoding` enum, 4-param forward declaration (defaults removed to avoid redefinition error)
- `dfloat_impl.hpp` — Complete rewrite (~900 lines): storage, combination field, arithmetic, conversions
- `dfloat.hpp` — Umbrella header with standard aliases
- `manipulators.hpp` — Updated for 4-param template, added `color_print`, `components`
- `attributes.hpp` — Updated for 4-param template

**Files created:**
- `dpd_codec.hpp` — DPD encode/decode using IEEE 754-2008 truth table
- `numeric_limits.hpp` — `radix=10`, `is_exact=true`
- `dfloat_traits.hpp` — `is_dfloat` trait
- `mathlib.hpp` + 13 function files — Math library delegating through double

#### hfloat: IBM System/360 Hexadecimal Floating-Point

**Design:** Template `hfloat<ndigits, es, bt>` where ndigits = hex fraction digits, es = exponent bits (7 for standard).

**Storage layout:** `[sign(1)] [exponent(7)] [hex_fraction(ndigits*4)]`

**Key behaviors:** No hidden bit, no NaN, no infinity, no subnormals. Truncation rounding only. Overflow saturates. Wobbling precision (0-3 leading zero bits in MSB hex digit). `SpecificValue::qnan/snan` → zero, `infpos/infneg` → maxpos/maxneg.

| Alias | Config | Bits |
|-------|--------|------|
| hfloat_short | `hfloat<6, 7>` | 1+7+24 = 32 |
| hfloat_long | `hfloat<14, 7>` | 1+7+56 = 64 |
| hfloat_extended | `hfloat<28, 7>` | 1+7+112 = 120 |

**All files created from scratch:** `hfloat_fwd.hpp`, `exceptions.hpp`, `hfloat_impl.hpp`, `hfloat.hpp`, `manipulators.hpp`, `attributes.hpp`, `numeric_limits.hpp`, `hfloat_traits.hpp`, `mathlib.hpp` + 13 function files, `CMakeLists.txt`, `api/api.cpp`

**CMake wiring:** 3 insertion points in root `CMakeLists.txt` — option, STATICS cascade, add_subdirectory.

### 2. `f3384524` — Add regression tests for dfloat and hfloat

**14 files created, 1845 insertions(+)**

#### dfloat regression tests (7 files):
- `conversion/assignment.cpp` — Integer/float round-trip, SpecificValue, unsigned types, DPD encoding, decimal exactness (10 * 0.1 = 1.0)
- `logic/logic.cpp` — ==, !=, <, >, <=, >= with positive, negative, and zero values
- `arithmetic/addition.cpp` — Basic, fractional (powers of 2), different scales, negatives, commutativity, inf/NaN
- `arithmetic/subtraction.cpp` — Basic, anti-commutativity
- `arithmetic/multiplication.cpp` — Basic, commutativity, multiplicative identity, inf/NaN
- `arithmetic/division.cpp` — Basic, self-division, division by zero, inf/NaN
- `standard/decimal32.cpp` — Field width static_asserts, special values, BID/DPD value and arithmetic agreement

#### hfloat regression tests (7 files):
- `conversion/assignment.cpp` — Integer/float round-trip, powers of 2, powers of 16, no-NaN/no-inf SpecificValue mapping, unsigned types
- `logic/logic.cpp` — All comparison operators with positive, negative, and zero values
- `arithmetic/addition.cpp` — Basic, powers of 2, commutativity, truncation rounding verification
- `arithmetic/subtraction.cpp` — Basic, anti-commutativity
- `arithmetic/multiplication.cpp` — Basic, commutativity, multiplicative identity, powers of 16
- `arithmetic/division.cpp` — Basic, self-division, truncation rounding (1/3), division by zero saturation
- `standard/short.cpp` — Field width static_asserts, no NaN/inf, trivially constructible, wobbling precision, type_tag, dynamic range

## Bugs Found and Fixed

1. **Default template argument redefinition**: `dfloat_fwd.hpp` and `dfloat_impl.hpp` both declared defaults for `DecimalEncoding`. Fix: removed defaults from forward declaration.

2. **Non-constexpr `nbits`**: Used `std::ceil(std::log2(std::pow(10.0, ...)))`. Fix: created `bid_trailing_bits()` with integer approximation.

3. **Protected `getbit()` access**: Free functions (`to_binary`, `color_print`) couldn't access protected member. Fix: moved to public section.

4. **Addition alignment bug** (100+3=100): Dividing rhs significand by 10^shift lost precision. Fix: scale UP the larger-exponent operand instead.

5. **hfloat quarter (0.25) = 0**: Hex exponent calculation for negative binary exponents was wrong. Fix: use `bin_exp / 4` (C integer division truncates toward zero = ceil for negatives).

6. **Test: 0.1 + 0.2 != 0.3**: C++ double literal `0.1` is already binary-imprecise; after round-trip through dfloat, `0.100000000000000005551...` + `0.200000000000000011102...` != `double(0.3)`. Fix: changed test to use powers-of-2 fractions that are exactly representable in both binary and decimal.

## Test Results

```
100% tests passed, 0 tests failed out of 17 (gcc)
100% tests passed, 0 tests failed out of 17 (clang)
```
Comment on lines +106 to +109
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add language specification to fenced code block.

The code block should have a language identifier for proper rendering and to satisfy markdown linting.

📝 Proposed fix
-```
+```text
 100% tests passed, 0 tests failed out of 17 (gcc)
 100% tests passed, 0 tests failed out of 17 (clang)
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.21.0)

[warning] 106-106: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/sessions/2026-02-26_dfloat_hfloat_implementation.md` around lines 106 -
109, The fenced code block showing the test output ("100% tests passed, 0 tests
failed out of 17 (gcc)" / "100% tests passed, 0 tests failed out of 17 (clang)")
must include a language identifier for proper markdown rendering; update the
block delimiter from ``` to ```text (or ```console) so the snippet becomes a
fenced code block with a language specifier and passes linting.


Tests:
1. dfloat_api, dfloat_logic, dfloat_assignment
2. dfloat_addition, dfloat_subtraction, dfloat_multiplication, dfloat_division
3. dfloat_decimal32, dfloat_dpd_codec
4. hfloat_api, hfloat_logic, hfloat_assignment
5. hfloat_addition, hfloat_subtraction, hfloat_multiplication, hfloat_division
6. hfloat_short

## Architecture Notes

- **BID vs DPD tradeoff**: BID stores trailing significand as binary integer (simple arithmetic, used by Intel), DPD stores as 10-bit declets (compact display, used by IBM/IEEE hardware). Same combination field for both.
- **hfloat wobbling precision**: A value like 1.0 (binary 0.0001 in hex) has 3 wasted leading zero bits in its first hex digit, giving only 21 effective fraction bits instead of 24. Value 8.0 (binary 0.1000) uses all 24 bits. This is a fundamental tradeoff of base-16 representation.
- **Truncation vs IEEE rounding**: hfloat always truncates (chops toward zero). This is simpler to implement in hardware but introduces systematic negative bias. IEEE 754 round-to-nearest-even eliminates this bias.
42 changes: 23 additions & 19 deletions include/sw/universal/number/dfloat/attributes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ namespace sw { namespace universal {
// in terms of native types.

// generate the maxneg through maxpos value range of a dfloat configuration
// TODO: needs SFINAE
template<typename DfloatConfiguration>
std::string dfloat_range() {
constexpr unsigned ndigits = DfloatConfiguration::nbits;
constexpr unsigned es = DfloatConfiguration::es;
constexpr unsigned nd = DfloatConfiguration::ndigits;
constexpr unsigned e = DfloatConfiguration::es;
constexpr DecimalEncoding enc = DfloatConfiguration::encoding;
using BlockType = typename DfloatConfiguration::BlockType;

using Dfloat = dfloat<ndigits, es, BlockType>;
using Dfloat = dfloat<nd, e, enc, BlockType>;
Dfloat v;
std::stringstream s;
s << std::setw(80) << type_tag(v) << " : [ "
Expand All @@ -32,40 +32,44 @@ std::string dfloat_range() {
return s.str();
}


// report dynamic range of a type, specialized for a dfloat
template<unsigned ndigits, unsigned es, typename bt>
std::string dynamic_range(const dfloat<ndigits, es, bt>& a) {
template<unsigned ndigits, unsigned es, DecimalEncoding Encoding, typename bt>
std::string dynamic_range(const dfloat<ndigits, es, Encoding, bt>& a) {
std::stringstream s;
dfloat<ndigits, es, bt> b(SpecificValue::maxneg), c(SpecificValue::minneg), d(SpecificValue::minpos), e(SpecificValue::maxpos);
dfloat<ndigits, es, Encoding, bt> b(SpecificValue::maxneg), c(SpecificValue::minneg), d(SpecificValue::minpos), e(SpecificValue::maxpos);
s << type_tag(a) << ": ";
s << "minpos scale " << std::setw(10) << d.scale() << " ";
s << "maxpos scale " << std::setw(10) << e.scale() << '\n';
s << "[" << b << " ... " << c << ", -0, +0, " << d << " ... " << e << "]\n";
s << "[" << to_binary(b) << " ... " << to_binary(c) << ", -0, +0, " << to_binary(d) << " ... " << to_binary(e) << "]\n";
dfloat<ndigits, es, bt> ninf(SpecificValue::infneg), pinf(SpecificValue::infpos);
dfloat<ndigits, es, Encoding, bt> ninf(SpecificValue::infneg), pinf(SpecificValue::infpos);
s << "inclusive range = (" << to_binary(ninf) << ", " << to_binary(pinf) << ")\n";
s << "inclusive range = (" << ninf << ", " << pinf << ")\n";
return s.str();
}


template<unsigned ndigits, unsigned es, typename bt>
int minpos_scale(const dfloat<ndigits, es, bt>& b) {
dfloat<ndigits, es, bt> c(b);
template<unsigned ndigits, unsigned es, DecimalEncoding Encoding, typename bt>
int minpos_scale(const dfloat<ndigits, es, Encoding, bt>& b) {
dfloat<ndigits, es, Encoding, bt> c(b);
return c.minpos().scale();
}

template<unsigned ndigits, unsigned es, typename bt>
int maxpos_scale(const dfloat<ndigits, es, bt>& b) {
dfloat<ndigits, es, bt> c(b);
template<unsigned ndigits, unsigned es, DecimalEncoding Encoding, typename bt>
int maxpos_scale(const dfloat<ndigits, es, Encoding, bt>& b) {
dfloat<ndigits, es, Encoding, bt> c(b);
return c.maxpos().scale();
}

template<unsigned ndigits, unsigned es, typename bt>
int max_negative_scale(const dfloat<ndigits, es, bt>& b) {
dfloat<ndigits, es, bt> c(b);
template<unsigned ndigits, unsigned es, DecimalEncoding Encoding, typename bt>
int max_negative_scale(const dfloat<ndigits, es, Encoding, bt>& b) {
dfloat<ndigits, es, Encoding, bt> c(b);
return c.maxneg().scale();
}

// free function for scale
template<unsigned ndigits, unsigned es, DecimalEncoding Encoding, typename bt>
int scale(const dfloat<ndigits, es, Encoding, bt>& a) {
return a.scale();
}

}} // namespace sw::universal
26 changes: 17 additions & 9 deletions include/sw/universal/number/dfloat/dfloat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <universal/utility/long_double.hpp>

////////////////////////////////////////////////////////////////////////////////////////
/// required std libraries
/// required std libraries
#include <iostream>
#include <iomanip>

Expand All @@ -36,15 +36,15 @@
#define DFLOAT_EXCEPT noexcept
#else
#if DFLOAT_THROW_ARITHMETIC_EXCEPTION
#define DFLOAT_EXCEPT
#define DFLOAT_EXCEPT
#else
#define DFLOAT_EXCEPT noexcept
#endif
#endif

////////////////////////////////////////////////////////////////////////////////////////
// enable native sqrt implementation
//
//
#if !defined(DFLOAT_NATIVE_SQRT)
#define DFLOAT_NATIVE_SQRT 0
#endif
Expand All @@ -60,21 +60,29 @@
#include <universal/number/dfloat/exceptions.hpp>
#include <universal/number/dfloat/dfloat_fwd.hpp>
#include <universal/number/dfloat/dfloat_impl.hpp>
//#include <universal/traits/dfloat_traits.hpp>
//#include <universal/number/dfloat/numeric_limits.hpp>
#include <universal/traits/dfloat_traits.hpp>
#include <universal/number/dfloat/numeric_limits.hpp>

// useful functions to work with cfloats
// useful functions to work with dfloats
#include <universal/number/dfloat/attributes.hpp>
#include <universal/number/dfloat/manipulators.hpp>

///////////////////////////////////////////////////////////////////////////////////////
/// elementary math functions library
//#include <universal/number/dfloat/mathlib.hpp>
#include <universal/number/dfloat/mathlib.hpp>

///////////////////////////////////////////////////////////////////////////////////////
/// aliases for industry standard floating point configurations
/// aliases for IEEE 754-2008 decimal floating-point configurations
namespace sw { namespace universal {

// IEEE-754
// BID encoding (default)
using decimal32 = dfloat<7, 6, DecimalEncoding::BID, uint32_t>;
using decimal64 = dfloat<16, 8, DecimalEncoding::BID, uint32_t>;
using decimal128 = dfloat<34, 12, DecimalEncoding::BID, uint32_t>;

// DPD encoding variants
using decimal32_dpd = dfloat<7, 6, DecimalEncoding::DPD, uint32_t>;
using decimal64_dpd = dfloat<16, 8, DecimalEncoding::DPD, uint32_t>;
using decimal128_dpd = dfloat<34, 12, DecimalEncoding::DPD, uint32_t>;

}} // namespace sw::universal
37 changes: 18 additions & 19 deletions include/sw/universal/number/dfloat/dfloat_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,28 @@

namespace sw { namespace universal {

// forward references
template<unsigned ndigits, unsigned es, typename BlockType> class dfloat;

template<unsigned ndigits, unsigned es, typename BlockType>
bool parse(const std::string& number, dfloat<ndigits, es, BlockType>& v);
// IEEE 754-2008 decimal floating-point encoding formats
enum class DecimalEncoding {
BID, // Binary Integer Decimal: significand stored as binary integer
DPD // Densely Packed Decimal: significand stored as 10-bit declets
};

template<unsigned ndigits, unsigned es, typename BlockType>
dfloat<ndigits, es, BlockType>
abs(const dfloat<ndigits, es, BlockType>&);

template<unsigned ndigits, unsigned es, typename BlockType>
dfloat<ndigits, es, BlockType>
sqrt(const dfloat<ndigits, es, BlockType>&);
// forward references
template<unsigned ndigits, unsigned es, DecimalEncoding Encoding, typename BlockType> class dfloat;

template<unsigned ndigits, unsigned es, typename BlockType>
dfloat<ndigits, es, BlockType>
fabs(dfloat<ndigits, es, BlockType>);
template<unsigned ndigits, unsigned es, DecimalEncoding Encoding, typename BlockType>
bool parse(const std::string& number, dfloat<ndigits, es, Encoding, BlockType>& v);

#ifdef DFLOAT_QUIRE
template<unsigned ndigits, unsigned es, DecimalEncoding Encoding, typename BlockType>
dfloat<ndigits, es, Encoding, BlockType>
abs(const dfloat<ndigits, es, Encoding, BlockType>&);

// quire types
template<unsigned ndigits, unsigned es, DecimalEncoding Encoding, typename BlockType>
dfloat<ndigits, es, Encoding, BlockType>
sqrt(const dfloat<ndigits, es, Encoding, BlockType>&);

#endif
template<unsigned ndigits, unsigned es, DecimalEncoding Encoding, typename BlockType>
dfloat<ndigits, es, Encoding, BlockType>
fabs(dfloat<ndigits, es, Encoding, BlockType>);

}} // namespace sw::universal

Loading
Loading