class IEEEFloat

Declaration

class IEEEFloat : public APFloatBase { /* full declaration omitted */ };

Description

A self-contained host- and target-independent arbitrary-precision floating-point software implementation. APFloat uses bignum integer arithmetic as provided by static functions in the APInt class. The library will work with bignum integers whose parts are any unsigned type at least 16 bits wide, but 64 bits is recommended. Written for clarity rather than speed, in particular with a view to use in the front-end of a cross compiler so that target arithmetic can be correctly performed on the host. Performance should nonetheless be reasonable, particularly for its intended use. It may be useful as a base implementation for a run-time library during development of a faster target-specific one. All 5 rounding modes in the IEEE-754R draft are handled correctly for all implemented operations. Currently implemented operations are add, subtract, multiply, divide, fused-multiply-add, conversion-to-float, conversion-to-integer and conversion-from-integer. New rounding modes (e.g. away from zero) can be added with three or four lines of code. Four formats are built-in: IEEE single precision, double precision, quadruple precision, and x87 80-bit extended double (when operating with full extended precision). Adding a new format that obeys IEEE semantics only requires adding two lines of code: a declaration and definition of the format. All operations return the status of that operation as an exception bit-mask, so multiple operations can be done consecutively with their results or-ed together. The returned status can be useful for compiler diagnostics; e.g., inexact, underflow and overflow can be easily diagnosed on constant folding, and compiler optimizers can determine what exceptions would be raised by folding operations and optimize, or perhaps not optimize, accordingly. At present, underflow tininess is detected after rounding; it should be straight forward to add support for the before-rounding case too. The library reads hexadecimal floating point numbers as per C99, and correctly rounds if necessary according to the specified rounding mode. Syntax is required to have been validated by the caller. It also converts floating point numbers to hexadecimal text as per the C99 %a and %A conversions. The output precision (or alternatively the natural minimal precision) can be specified; if the requested precision is less than the natural precision the output is correctly rounded for the specified rounding mode. It also reads decimal floating point numbers and correctly rounds according to the specified rounding mode. Conversion to decimal text is not currently implemented. Non-zero finite numbers are represented internally as a sign bit, a 16-bit signed exponent, and the significand as an array of integer parts. After normalization of a number of precision P the exponent is within the range of the format, and if the number is not denormal the P-th bit of the significand is set as an explicit integer bit. For denormals the most significant bit is shifted right so that the exponent is maintained at the format's minimum, so that the smallest denormal has just the least significant bit of the significand set. The sign of zeroes and infinities is significant; the exponent and significand of such numbers is not stored, but has a known implicit (deterministic) value: 0 for the significands, 0 for zero exponent, all 1 bits for infinity exponent. For NaNs the sign and significand are deterministic, although not really meaningful, and preserved in non-conversion operations. The exponent is implicitly all 1 bits. APFloat does not provide any exception handling beyond default exception handling. We represent Signaling NaNs via IEEE-754R 2008 6.2.1 should clause by encoding Signaling NaNs with the first bit of its trailing significand as 0. TODO ==== Some features that may or may not be worth adding: Binary to decimal conversion (hard). Optional ability to detect underflow tininess before rounding. New formats: x87 in single and double precision mode (IEEE apart from extended exponent range) (hard). New operations: sqrt, IEEE remainder, C90 fmod, nexttoward.

Declared at: llvm/include/llvm/ADT/APFloat.h:247

Inherits from: APFloatBase

Member Variables

private const llvm::fltSemantics* semantics
Note: this must be the first data member. The semantics that this value obeys.
private union Significand significand
private llvm::APFloatBase::ExponentType exponent
The signed unbiased exponent of the value.
private llvm::APFloatBase::fltCategory category
Only 2 bits are required, but VisualStudio incorrectly sign extends it. Using the extra bit keeps it from failing under VisualStudio.
private unsigned int sign
Sign bit of the number.

Inherited from APFloatBase:

public static integerPartWidth = APInt::APINT_BITS_PER_WORD
public static rmNearestTiesToEven = RoundingMode::NearestTiesToEven
public static rmTowardPositive = RoundingMode::TowardPositive
public static rmTowardNegative = RoundingMode::TowardNegative
public static rmTowardZero = RoundingMode::TowardZero
public static rmNearestTiesToAway = RoundingMode::NearestTiesToAway

Method Overview

Inherited from APFloatBase:

Methods

IEEEFloat(const llvm::fltSemantics&,
          llvm::APFloatBase::integerPart)

Declared at: llvm/include/llvm/ADT/APFloat.h:253

Parameters

const llvm::fltSemantics&
llvm::APFloatBase::integerPart

IEEEFloat(const llvm::fltSemantics&,
          llvm::APFloatBase::uninitializedTag)

Declared at: llvm/include/llvm/ADT/APFloat.h:254

Parameters

const llvm::fltSemantics&
llvm::APFloatBase::uninitializedTag

IEEEFloat(const llvm::fltSemantics&,
          const llvm::APInt&)

Declared at: llvm/include/llvm/ADT/APFloat.h:255

Parameters

const llvm::fltSemantics&
const llvm::APInt&

IEEEFloat(double d)

Declared at: llvm/include/llvm/ADT/APFloat.h:256

Parameters

double d

IEEEFloat(float f)

Declared at: llvm/include/llvm/ADT/APFloat.h:257

Parameters

float f

IEEEFloat(const llvm::detail::IEEEFloat&)

Declared at: llvm/include/llvm/ADT/APFloat.h:258

Parameters

const llvm::detail::IEEEFloat&

IEEEFloat(llvm::detail::IEEEFloat&&)

Declared at: llvm/include/llvm/ADT/APFloat.h:259

Parameters

llvm::detail::IEEEFloat&&

IEEEFloat(const llvm::fltSemantics&)

Description

@ {

Declared at: llvm/include/llvm/ADT/APFloat.h:252

Parameters

const llvm::fltSemantics&

llvm::APFloatBase::opStatus add(
    const llvm::detail::IEEEFloat&,
    llvm::APFloatBase::roundingMode)

Description

@ {

Declared at: llvm/include/llvm/ADT/APFloat.h:275

Parameters

const llvm::detail::IEEEFloat&
llvm::APFloatBase::roundingMode

llvm::APFloatBase::opStatus addOrSubtract(
    const llvm::detail::IEEEFloat&,
    llvm::APFloatBase::roundingMode,
    bool subtract)

Declared at: llvm/include/llvm/ADT/APFloat.h:528

Parameters

const llvm::detail::IEEEFloat&
llvm::APFloatBase::roundingMode
bool subtract

llvm::lostFraction addOrSubtractSignificand(
    const llvm::detail::IEEEFloat&,
    bool subtract)

Declared at: llvm/include/llvm/ADT/APFloat.h:494

Parameters

const llvm::detail::IEEEFloat&
bool subtract

llvm::APFloatBase::opStatus addOrSubtractSpecials(
    const llvm::detail::IEEEFloat&,
    bool subtract)

Description

@ {

Declared at: llvm/include/llvm/ADT/APFloat.h:515

Parameters

const llvm::detail::IEEEFloat&
bool subtract

llvm::APFloatBase::integerPart addSignificand(
    const llvm::detail::IEEEFloat&)

Description

@ {

Declared at: llvm/include/llvm/ADT/APFloat.h:492

Parameters

const llvm::detail::IEEEFloat&

void assign(const llvm::detail::IEEEFloat&)

Declared at: llvm/include/llvm/ADT/APFloat.h:564

Parameters

const llvm::detail::IEEEFloat&

llvm::APInt bitcastToAPInt() const

Declared at: llvm/include/llvm/ADT/APFloat.h:309

bool bitwiseIsEqual(
    const llvm::detail::IEEEFloat&) const

Description

Bitwise comparison for equality (QNaNs compare equal, 0!=-0).

Declared at: llvm/include/llvm/ADT/APFloat.h:325

Parameters

const llvm::detail::IEEEFloat&

void changeSign()

Description

@ {

Declared at: llvm/include/llvm/ADT/APFloat.h:293

llvm::APFloatBase::cmpResult compare(
    const llvm::detail::IEEEFloat&) const

Description

IEEE comparison with another floating point number (NaNs compare unordered, 0==-0).

Declared at: llvm/include/llvm/ADT/APFloat.h:322

Parameters

const llvm::detail::IEEEFloat&

llvm::APFloatBase::cmpResult compareAbsoluteValue(
    const llvm::detail::IEEEFloat&) const

Description

@ }

Declared at: llvm/include/llvm/ADT/APFloat.h:477

Parameters

const llvm::detail::IEEEFloat&

llvm::APFloatBase::opStatus convert(
    const llvm::fltSemantics&,
    llvm::APFloatBase::roundingMode,
    bool*)

Description

@ {

Declared at: llvm/include/llvm/ADT/APFloat.h:300

Parameters

const llvm::fltSemantics&
llvm::APFloatBase::roundingMode
bool*

llvm::APInt convertBFloatAPFloatToAPInt() const

Declared at: llvm/include/llvm/ADT/APFloat.h:549

llvm::APInt convertDoubleAPFloatToAPInt() const

Declared at: llvm/include/llvm/ADT/APFloat.h:551

llvm::APInt convertF80LongDoubleAPFloatToAPInt()
    const

Declared at: llvm/include/llvm/ADT/APFloat.h:553

llvm::APInt convertFloatAPFloatToAPInt() const

Declared at: llvm/include/llvm/ADT/APFloat.h:550

llvm::APFloatBase::opStatus convertFromAPInt(
    const llvm::APInt&,
    bool,
    llvm::APFloatBase::roundingMode)

Declared at: llvm/include/llvm/ADT/APFloat.h:303

Parameters

const llvm::APInt&
bool
llvm::APFloatBase::roundingMode

Expected<llvm::APFloatBase::opStatus>
convertFromDecimalString(
    llvm::StringRef,
    llvm::APFloatBase::roundingMode)

Declared at: llvm/include/llvm/ADT/APFloat.h:537

Parameters

llvm::StringRef
llvm::APFloatBase::roundingMode

Expected<llvm::APFloatBase::opStatus>
convertFromHexadecimalString(
    llvm::StringRef,
    llvm::APFloatBase::roundingMode)

Declared at: llvm/include/llvm/ADT/APFloat.h:536

Parameters

llvm::StringRef
llvm::APFloatBase::roundingMode

llvm::APFloatBase::opStatus
convertFromSignExtendedInteger(
    const llvm::APFloatBase::integerPart*,
    unsigned int,
    bool,
    llvm::APFloatBase::roundingMode)

Declared at: llvm/include/llvm/ADT/APFloat.h:304

Parameters

const llvm::APFloatBase::integerPart*
unsigned int
bool
llvm::APFloatBase::roundingMode

Expected<llvm::APFloatBase::opStatus>
convertFromString(llvm::StringRef,
                  llvm::APFloatBase::roundingMode)

Declared at: llvm/include/llvm/ADT/APFloat.h:308

Parameters

llvm::StringRef
llvm::APFloatBase::roundingMode

bool convertFromStringSpecials(
    llvm::StringRef str)

Description

@ {

Declared at: llvm/include/llvm/ADT/APFloat.h:526

Parameters

llvm::StringRef str

llvm::APFloatBase::opStatus
convertFromUnsignedParts(
    const llvm::APFloatBase::integerPart*,
    unsigned int,
    llvm::APFloatBase::roundingMode)

Declared at: llvm/include/llvm/ADT/APFloat.h:534

Parameters

const llvm::APFloatBase::integerPart*
unsigned int
llvm::APFloatBase::roundingMode

llvm::APFloatBase::opStatus
convertFromZeroExtendedInteger(
    const llvm::APFloatBase::integerPart*,
    unsigned int,
    bool,
    llvm::APFloatBase::roundingMode)

Declared at: llvm/include/llvm/ADT/APFloat.h:306

Parameters

const llvm::APFloatBase::integerPart*
unsigned int
bool
llvm::APFloatBase::roundingMode

llvm::APInt convertHalfAPFloatToAPInt() const

Description

@ }

Declared at: llvm/include/llvm/ADT/APFloat.h:548

char* convertNormalToHexString(
    char*,
    unsigned int,
    bool,
    llvm::APFloatBase::roundingMode) const

Declared at: llvm/include/llvm/ADT/APFloat.h:538

Parameters

char*
unsigned int
bool
llvm::APFloatBase::roundingMode

llvm::APInt convertPPCDoubleDoubleAPFloatToAPInt()
    const

Declared at: llvm/include/llvm/ADT/APFloat.h:554

llvm::APInt convertQuadrupleAPFloatToAPInt() const

Declared at: llvm/include/llvm/ADT/APFloat.h:552

double convertToDouble() const

Declared at: llvm/include/llvm/ADT/APFloat.h:310

float convertToFloat() const

Declared at: llvm/include/llvm/ADT/APFloat.h:311

unsigned int convertToHexString(
    char* dst,
    unsigned int hexDigits,
    bool upperCase,
    llvm::APFloatBase::roundingMode) const

Description

Write out a hexadecimal representation of the floating point value to DST, which must be of sufficient size, in the C99 form [-]0xh.hhhhp[+-]d. Return the number of characters written, excluding the terminating NUL.

Declared at: llvm/include/llvm/ADT/APFloat.h:330

Parameters

char* dst
unsigned int hexDigits
bool upperCase
llvm::APFloatBase::roundingMode

llvm::APFloatBase::opStatus convertToInteger(
    MutableArrayRef<
        llvm::APFloatBase::integerPart>,
    unsigned int,
    bool,
    llvm::APFloatBase::roundingMode,
    bool*) const

Declared at: llvm/include/llvm/ADT/APFloat.h:301

Parameters

MutableArrayRef<llvm::APFloatBase::integerPart>
unsigned int
bool
llvm::APFloatBase::roundingMode
bool*

llvm::APFloatBase::opStatus
convertToSignExtendedInteger(
    MutableArrayRef<
        llvm::APFloatBase::integerPart>,
    unsigned int,
    bool,
    llvm::APFloatBase::roundingMode,
    bool*) const

Declared at: llvm/include/llvm/ADT/APFloat.h:531

Parameters

MutableArrayRef<llvm::APFloatBase::integerPart>
unsigned int
bool
llvm::APFloatBase::roundingMode
bool*

void copySignificand(
    const llvm::detail::IEEEFloat&)

Declared at: llvm/include/llvm/ADT/APFloat.h:565

Parameters

const llvm::detail::IEEEFloat&

llvm::APFloatBase::opStatus divide(
    const llvm::detail::IEEEFloat&,
    llvm::APFloatBase::roundingMode)

Declared at: llvm/include/llvm/ADT/APFloat.h:278

Parameters

const llvm::detail::IEEEFloat&
llvm::APFloatBase::roundingMode

llvm::lostFraction divideSignificand(
    const llvm::detail::IEEEFloat&)

Declared at: llvm/include/llvm/ADT/APFloat.h:497

Parameters

const llvm::detail::IEEEFloat&

llvm::APFloatBase::opStatus divideSpecials(
    const llvm::detail::IEEEFloat&)

Declared at: llvm/include/llvm/ADT/APFloat.h:516

Parameters

const llvm::detail::IEEEFloat&

llvm::APFloatBase::ExponentType exponentInf()
    const

Declared at: llvm/include/llvm/ADT/APFloat.h:543

llvm::APFloatBase::ExponentType exponentNaN()
    const

Declared at: llvm/include/llvm/ADT/APFloat.h:542

llvm::APFloatBase::ExponentType exponentZero()
    const

Declared at: llvm/include/llvm/ADT/APFloat.h:544

void freeSignificand()

Declared at: llvm/include/llvm/ADT/APFloat.h:566

llvm::APFloatBase::opStatus fusedMultiplyAdd(
    const llvm::detail::IEEEFloat&,
    const llvm::detail::IEEEFloat&,
    llvm::APFloatBase::roundingMode)

Declared at: llvm/include/llvm/ADT/APFloat.h:283

Parameters

const llvm::detail::IEEEFloat&
const llvm::detail::IEEEFloat&
llvm::APFloatBase::roundingMode

llvm::APFloatBase::fltCategory getCategory() const

Description

@ {

Declared at: llvm/include/llvm/ADT/APFloat.h:375

bool getExactInverse(llvm::APFloat* inv) const

Description

If this value has an exact multiplicative inverse, store it in inv and return true.

Declared at: llvm/include/llvm/ADT/APFloat.h:440

Parameters

llvm::APFloat* inv

const llvm::fltSemantics& getSemantics() const

Declared at: llvm/include/llvm/ADT/APFloat.h:376

llvm::APFloatBase::opStatus handleOverflow(
    llvm::APFloatBase::roundingMode)

Declared at: llvm/include/llvm/ADT/APFloat.h:529

Parameters

llvm::APFloatBase::roundingMode

void incrementSignificand()

Declared at: llvm/include/llvm/ADT/APFloat.h:498

void initFromAPInt(const llvm::fltSemantics* Sem,
                   const llvm::APInt& api)

Declared at: llvm/include/llvm/ADT/APFloat.h:555

Parameters

const llvm::fltSemantics* Sem
const llvm::APInt& api

void initFromBFloatAPInt(const llvm::APInt& api)

Declared at: llvm/include/llvm/ADT/APFloat.h:557

Parameters

const llvm::APInt& api

void initFromDoubleAPInt(const llvm::APInt& api)

Declared at: llvm/include/llvm/ADT/APFloat.h:559

Parameters

const llvm::APInt& api

void initFromF80LongDoubleAPInt(
    const llvm::APInt& api)

Declared at: llvm/include/llvm/ADT/APFloat.h:561

Parameters

const llvm::APInt& api

void initFromFloatAPInt(const llvm::APInt& api)

Declared at: llvm/include/llvm/ADT/APFloat.h:558

Parameters

const llvm::APInt& api

void initFromHalfAPInt(const llvm::APInt& api)

Declared at: llvm/include/llvm/ADT/APFloat.h:556

Parameters

const llvm::APInt& api

void initFromPPCDoubleDoubleAPInt(
    const llvm::APInt& api)

Declared at: llvm/include/llvm/ADT/APFloat.h:562

Parameters

const llvm::APInt& api

void initFromQuadrupleAPInt(
    const llvm::APInt& api)

Declared at: llvm/include/llvm/ADT/APFloat.h:560

Parameters

const llvm::APInt& api

void initialize(const llvm::fltSemantics*)

Declared at: llvm/include/llvm/ADT/APFloat.h:499

Parameters

const llvm::fltSemantics*

bool isDenormal() const

Description

IEEE-754R isSubnormal(): Returns true if and only if the float is a denormal.

Declared at: llvm/include/llvm/ADT/APFloat.h:359

bool isFinite() const

Description

Returns true if and only if the current value is zero, subnormal, or normal. This means that the value is not infinite or NaN.

Declared at: llvm/include/llvm/ADT/APFloat.h:352

bool isFiniteNonZero() const

Declared at: llvm/include/llvm/ADT/APFloat.h:378

bool isInfinity() const

Description

IEEE-754R isInfinite(): Returns true if and only if the float is infinity.

Declared at: llvm/include/llvm/ADT/APFloat.h:362

bool isInteger() const

Description

Returns true if and only if the number is an exact integer.

Declared at: llvm/include/llvm/ADT/APFloat.h:391

bool isLargest() const

Description

Returns true if and only if the number has the largest possible finite magnitude in the current semantics.

Declared at: llvm/include/llvm/ADT/APFloat.h:388

bool isNaN() const

Description

Returns true if and only if the float is a quiet or signaling NaN.

Declared at: llvm/include/llvm/ADT/APFloat.h:365

bool isNegZero() const

Declared at: llvm/include/llvm/ADT/APFloat.h:380

bool isNegative() const

Description

IEEE-754R isSignMinus: Returns true if and only if the current value is negative. This applies to zeros and NaNs as well.

Declared at: llvm/include/llvm/ADT/APFloat.h:340

bool isNonZero() const

Declared at: llvm/include/llvm/ADT/APFloat.h:377

bool isNormal() const

Description

IEEE-754R isNormal: Returns true if and only if the current value is normal. This implies that the current value of the float is not zero, subnormal, infinite, or NaN following the definition of normality from IEEE-754R.

Declared at: llvm/include/llvm/ADT/APFloat.h:346

bool isPosZero() const

Declared at: llvm/include/llvm/ADT/APFloat.h:379

bool isSignaling() const

Description

Returns true if and only if the float is a signaling NaN.

Declared at: llvm/include/llvm/ADT/APFloat.h:368

bool isSignificandAllOnes() const

Description

Return true if the significand excluding the integral bit is all ones.

Declared at: llvm/include/llvm/ADT/APFloat.h:506

bool isSignificandAllZeros() const

Description

Return true if the significand excluding the integral bit is all zeros.

Declared at: llvm/include/llvm/ADT/APFloat.h:508

bool isSmallest() const

Description

Returns true if and only if the number has the smallest possible non-zero magnitude in the current semantics.

Declared at: llvm/include/llvm/ADT/APFloat.h:384

bool isZero() const

Description

Returns true if and only if the float is plus or minus zero.

Declared at: llvm/include/llvm/ADT/APFloat.h:355

void makeInf(bool Neg = false)

Declared at: llvm/include/llvm/ADT/APFloat.h:465

Parameters

bool Neg = false

void makeLargest(bool Neg = false)

Description

@ {

Declared at: llvm/include/llvm/ADT/APFloat.h:461

Parameters

bool Neg = false

void makeNaN(bool SNaN = false,
             bool Neg = false,
             const llvm::APInt* fill = nullptr)

Declared at: llvm/include/llvm/ADT/APFloat.h:463

Parameters

bool SNaN = false
bool Neg = false
const llvm::APInt* fill = nullptr

void makeQuiet()

Declared at: llvm/include/llvm/ADT/APFloat.h:467

void makeSmallest(bool Neg = false)

Declared at: llvm/include/llvm/ADT/APFloat.h:462

Parameters

bool Neg = false

void makeSmallestNormalized(bool Negative = false)

Description

Returns the smallest (by magnitude) normalized finite number in the given semantics.

Declared at: llvm/include/llvm/ADT/APFloat.h:473

Parameters

bool Negative = false
- True iff the number should be negative

void makeZero(bool Neg = false)

Declared at: llvm/include/llvm/ADT/APFloat.h:466

Parameters

bool Neg = false

llvm::APFloatBase::opStatus mod(
    const llvm::detail::IEEEFloat&)

Description

C fmod, or llvm frem.

Declared at: llvm/include/llvm/ADT/APFloat.h:282

Parameters

const llvm::detail::IEEEFloat&

llvm::APFloatBase::opStatus modSpecials(
    const llvm::detail::IEEEFloat&)

Declared at: llvm/include/llvm/ADT/APFloat.h:518

Parameters

const llvm::detail::IEEEFloat&

llvm::APFloatBase::opStatus multiply(
    const llvm::detail::IEEEFloat&,
    llvm::APFloatBase::roundingMode)

Declared at: llvm/include/llvm/ADT/APFloat.h:277

Parameters

const llvm::detail::IEEEFloat&
llvm::APFloatBase::roundingMode

llvm::lostFraction multiplySignificand(
    const llvm::detail::IEEEFloat&)

Declared at: llvm/include/llvm/ADT/APFloat.h:496

Parameters

const llvm::detail::IEEEFloat&

llvm::lostFraction multiplySignificand(
    const llvm::detail::IEEEFloat&,
    llvm::detail::IEEEFloat)

Declared at: llvm/include/llvm/ADT/APFloat.h:495

Parameters

const llvm::detail::IEEEFloat&
llvm::detail::IEEEFloat

llvm::APFloatBase::opStatus multiplySpecials(
    const llvm::detail::IEEEFloat&)

Declared at: llvm/include/llvm/ADT/APFloat.h:517

Parameters

const llvm::detail::IEEEFloat&

bool needsCleanup() const

Description

Returns whether this instance allocated memory.

Declared at: llvm/include/llvm/ADT/APFloat.h:265

llvm::APFloatBase::opStatus next(bool nextDown)

Description

IEEE-754R 5.3.1: nextUp/nextDown.

Declared at: llvm/include/llvm/ADT/APFloat.h:286

Parameters

bool nextDown

llvm::APFloatBase::opStatus normalize(
    llvm::APFloatBase::roundingMode,
    llvm::lostFraction)

Declared at: llvm/include/llvm/ADT/APFloat.h:527

Parameters

llvm::APFloatBase::roundingMode
llvm::lostFraction

unsigned int partCount() const

Declared at: llvm/include/llvm/ADT/APFloat.h:485

llvm::APFloatBase::opStatus remainder(
    const llvm::detail::IEEEFloat&)

Description

IEEE remainder.

Declared at: llvm/include/llvm/ADT/APFloat.h:280

Parameters

const llvm::detail::IEEEFloat&

llvm::APFloatBase::opStatus remainderSpecials(
    const llvm::detail::IEEEFloat&)

Declared at: llvm/include/llvm/ADT/APFloat.h:519

Parameters

const llvm::detail::IEEEFloat&

bool roundAwayFromZero(
    llvm::APFloatBase::roundingMode,
    llvm::lostFraction,
    unsigned int) const

Declared at: llvm/include/llvm/ADT/APFloat.h:530

Parameters

llvm::APFloatBase::roundingMode
llvm::lostFraction
unsigned int

llvm::APFloatBase::opStatus
roundSignificandWithExponent(
    const llvm::APFloatBase::integerPart*,
    unsigned int,
    int,
    llvm::APFloatBase::roundingMode)

Declared at: llvm/include/llvm/ADT/APFloat.h:540

Parameters

const llvm::APFloatBase::integerPart*
unsigned int
int
llvm::APFloatBase::roundingMode

llvm::APFloatBase::opStatus roundToIntegral(
    llvm::APFloatBase::roundingMode)

Declared at: llvm/include/llvm/ADT/APFloat.h:284

Parameters

llvm::APFloatBase::roundingMode

void shiftSignificandLeft(unsigned int)

Declared at: llvm/include/llvm/ADT/APFloat.h:500

Parameters

unsigned int

llvm::lostFraction shiftSignificandRight(
    unsigned int)

Declared at: llvm/include/llvm/ADT/APFloat.h:501

Parameters

unsigned int

unsigned int significandLSB() const

Declared at: llvm/include/llvm/ADT/APFloat.h:502

unsigned int significandMSB() const

Declared at: llvm/include/llvm/ADT/APFloat.h:503

const llvm::APFloatBase::integerPart*
significandParts() const

Declared at: llvm/include/llvm/ADT/APFloat.h:484

llvm::APFloatBase::integerPart* significandParts()

Description

@ {

Declared at: llvm/include/llvm/ADT/APFloat.h:483

llvm::APFloatBase::opStatus subtract(
    const llvm::detail::IEEEFloat&,
    llvm::APFloatBase::roundingMode)

Declared at: llvm/include/llvm/ADT/APFloat.h:276

Parameters

const llvm::detail::IEEEFloat&
llvm::APFloatBase::roundingMode

llvm::APFloatBase::integerPart
subtractSignificand(
    const llvm::detail::IEEEFloat&,
    llvm::APFloatBase::integerPart)

Declared at: llvm/include/llvm/ADT/APFloat.h:493

Parameters

const llvm::detail::IEEEFloat&
llvm::APFloatBase::integerPart

void toString(SmallVectorImpl<char>& Str,
              unsigned int FormatPrecision = 0,
              unsigned int FormatMaxPadding = 3,
              bool TruncateZero = true) const

Description

Converts this value into a decimal string. Number Precision MaxPadding Result ------ --------- ---------- ------ 1.01E+4 5 2 10100 1.01E+4 4 2 1.01E+4 1.01E+4 5 1 1.01E+4 1.01E-2 5 2 0.0101 1.01E-2 4 2 0.0101 1.01E-2 4 1 1.01E-2

Declared at: llvm/include/llvm/ADT/APFloat.h:435

Parameters

SmallVectorImpl<char>& Str
unsigned int FormatPrecision = 0
The maximum number of digits of precision to output. If there are fewer digits available, zero padding will not be used unless the value is integral and small enough to be expressed in FormatPrecision digits. 0 means to use the natural precision of the number.
unsigned int FormatMaxPadding = 3
The maximum number of zeros to consider inserting before falling back to scientific notation. 0 means to always use scientific notation.
bool TruncateZero = true
Indicate whether to remove the trailing zero in fraction part or not. Also setting this parameter to false forcing producing of output more similar to default printf behavior. Specifically the lower e is used as exponent delimiter and exponent always contains no less than two digits.

void zeroSignificand()

Declared at: llvm/include/llvm/ADT/APFloat.h:504

~IEEEFloat()

Declared at: llvm/include/llvm/ADT/APFloat.h:260