【发布时间】:2016-10-28 05:54:22
【问题描述】:
我正在处理一个读取整数并将它们放入数组中直到输入负数的赋值。我必须找到整数的平均值,但结果必须以浮点数形式打印出来。我已经尝试了几种方法,但到目前为止,当我在 QTSimp 上运行它时,结果显示为“nan”。
这是我的代码部分
mfc1 $t6, $f1 #t6 is the sum
cvt.s.w $f1, $f1
mfc1 $t7, $f2 #t7 is the number of ints
cvt.s.w $f2, $f2
div.s $f0, $f1, $f2
mov.s $f12, $f0
li $v0, 2
syscall
【问题讨论】:
标签: assembly type-conversion mips division floating