I have a assignment in Computer Organization Course. My assignment is, find a pi value within 10 decimal digits. I found pi value by using Leibniz Forumla(It's not important for you). I used double floating point registers, finally I found pi value within 16 decimal digits but my teacher wants within 10 decimal digits and we should convert floating point to string. My problem rises here. I can not convert this 16 decimal digits to 10 decimal digits. I can not convert double fp to string. In fact I researched on the Internet, in this site but I couldn't find important information about this problem. What should I do? Can you give me an advice? What sites, documents are helful for me? I will not share all code because it's forbidden for us. I can print like these : li $v0, 3 #print approximate pi value mov.d $f12, $f20 # Move contents of register $f20 to register $f12 syscall
pi value is stored in $f20.
Aucun commentaire:
Enregistrer un commentaire