Skip to content

Commit 29fae0a

Browse files
Fixed bitwidth adaption on division for FLOAT.
1 parent 598634b commit 29fae0a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ugbc/src/targets/common/_infrastructure.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5138,9 +5138,10 @@ Variable * variable_div( Environment * _environment, char * _source, char * _des
51385138
}
51395139
}
51405140

5141-
// int best = calculate_cast_type_best_fit( _environment, source->type, target->type );
5142-
// source = variable_cast( _environment, source->name, best );
5143-
// target = variable_cast( _environment, target->name, best );
5141+
if ( source->type == VT_FLOAT || target->type == VT_FLOAT ) {
5142+
source = variable_cast( _environment, source->name, VT_FLOAT );
5143+
target = variable_cast( _environment, target->name, VT_FLOAT );
5144+
}
51445145

51455146
Variable * result = NULL;
51465147
Variable * realTarget = NULL;

0 commit comments

Comments
 (0)