mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
adjustments to floating-point printing
This commit is contained in:
parent
91ef0680da
commit
a027a5cdd8
3 changed files with 46 additions and 13 deletions
|
@ -71,6 +71,7 @@ FloatFormat::FloatFormat(int4 sz)
|
|||
jbitimplied = true;
|
||||
}
|
||||
maxexponent = (1<<exp_size)-1;
|
||||
calcPrecision();
|
||||
}
|
||||
|
||||
/// \param sign is set to \b true if the value should be negative
|
||||
|
@ -227,6 +228,13 @@ uintb FloatFormat::getNaNEncoding(bool sgn) const
|
|||
return setSign(res,sgn);
|
||||
}
|
||||
|
||||
void FloatFormat::calcPrecision(void)
|
||||
|
||||
{
|
||||
float val = frac_size * 0.30103;
|
||||
decimal_precision = (int4)floor(val + 0.5);
|
||||
}
|
||||
|
||||
/// \param encoding is the encoding value
|
||||
/// \param type points to the floating-point class, which is passed back
|
||||
/// \return the equivalent double value
|
||||
|
@ -613,4 +621,5 @@ void FloatFormat::restoreXml(const Element *el)
|
|||
}
|
||||
jbitimplied = xml_readbool(el->getAttributeValue("jbitimplied"));
|
||||
maxexponent = (1<<exp_size)-1;
|
||||
calcPrecision();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue