AK: Add 16-bit float type

This commit is contained in:
rmg-x 2024-11-09 14:25:05 -06:00 committed by Andrew Kaster
commit c1ec2ddb63
Notes: github-actions[bot] 2024-11-10 21:49:27 +00:00
5 changed files with 34 additions and 0 deletions

View file

@ -1012,6 +1012,13 @@ ErrorOr<void> Formatter<long double>::format(FormatBuilder& builder, long double
return builder.put_f80(value, base, upper_case, m_use_separator, m_align, m_width.value(), m_precision.value(), m_fill, m_sign_mode, real_number_display_mode);
}
ErrorOr<void> Formatter<f16>::format(FormatBuilder& builder, f16 value)
{
// FIXME: Create a proper put_f16() implementation
Formatter<double> formatter { *this };
return TRY(formatter.format(builder, static_cast<double>(value)));
}
ErrorOr<void> Formatter<double>::format(FormatBuilder& builder, double value)
{
u8 base;