Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
6de1dfa0
Commit
6de1dfa0
authored
Feb 01, 2015
by
Christoph Mallon
Browse files
tv: Print the sign of NaN and zero, too.
parent
314a1662
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/tv/fltcalc.c
View file @
6de1dfa0
...
...
@@ -925,12 +925,13 @@ bool fc_is_subnormal(const fp_value *a)
int
fc_print
(
const
fp_value
*
val
,
char
*
buf
,
size_t
buflen
,
fc_base_t
base
)
{
switch
((
value_class_t
)
val
->
clss
)
{
case
FC_INF
:
return
snprintf
(
buf
,
buflen
,
"%cINF"
,
val
->
sign
?
'-'
:
'+'
);
case
FC_NAN
:
return
snprintf
(
buf
,
buflen
,
"NaN"
);
case
FC_ZERO
:
return
snprintf
(
buf
,
buflen
,
"0.0"
);
char
const
*
v
;
case
FC_INF
:
v
=
"INF"
;
goto
special
;
case
FC_NAN
:
v
=
"NaN"
;
goto
special
;
case
FC_ZERO
:
v
=
"0.0"
;
goto
special
;
special:
return
snprintf
(
buf
,
buflen
,
"%c%s"
,
val
->
sign
?
'-'
:
'+'
,
v
);
case
FC_SUBNORMAL
:
case
FC_NORMAL
:
{
long
double
flt_val
=
fc_val_to_ieee754
(
val
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment