简体   繁体   English

MIPS将整数转换为float

[英]MIPS Converting integer to float

I'm really new in MIPS assembly and I am wondering can I do something like: 我是MIPS组装的新手,我想知道我可以这样做:

在此输入图像描述 Not just three characters number, any length of X and Y 不只是三个字符数,X和Y的任何长度

Please help If you know the algorithm or where can I find the code or algorithm 请帮助如果您知道算法或在哪里可以找到代码或算法

(Sorry I thought image might describe better and faster) (对不起,我认为图像可能更好更快地描述)

Thank you ... 谢谢 ...

Consider the following pseudo-code: 考虑以下伪代码:

int x = input
int y = input

while y > 1:
    y = y / 10

return x + y

Of course you will have to be cognizant of the normal floating point precision sticking points, ie that this can only at best get you as close as possible to XXX.YYY given the representation. 当然,您必须认识到正常的浮点精度粘滞点,即这最多只能使您尽可能接近XXX.YYY给出表示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM