<html> <head> <title>String to Double</title> <meta http-equiv="content-type" content="text/html; charset=WINDOWS-1251"> <style> body { font-size: 15px; font-family: "Bookman Old Style"; color: black; text-align: justify; width: 750px; } h1 { color: white; background-color: 808080; font-size: 25px; text-align: center; } h2 { color: green; font-size: 21px; } h3 { color: green; font-size: 19px; } h4 { color: #803f00; font-size: 17px; } i { color: #0099cc; } b { color: #0099cc; } p { text-indent: 2em; margin-top: 3px; margin-bottom: 2px; margin-left: 0px; margin-right: 0px; } ol, ul, dl{ margin-top: 3px; margin-bottom: 2px; } </style> </head> <body> <h1>String to Double 07.09.2011</h1> <p>Ïðîãðàììà äëÿ ïðåîáðàçîâàíèÿ ÷èñåë èç ñòðîêè â ôîðìàò float, double, à òàêæå èç 10 èëè 16 ðè÷íîãî âî float.</p> <p>Ñäåëàíà íà îñíîâå ïðîãðàììû <b>hex2dec2bin</b> è ïðèìåðîâ èç ôàéëà list2_05.inc (àâòîð Êóëàêîâ Âëàäèìèð Ãåííàäüåâè÷ 24.05.2002), êîòîðûå <b>ChE</b> ïåðåäåëàë ñ 16 íà 32 áèòà íà àññåìáëåð fasm.</p> <p>Ïðîãðàììà ïîçâîëÿåò ðåøàòü òàêèå çàäà÷è:</p> <p>1) ÷èñëî â ñòðîêîâîì âèäå ïåðåâåñòè â 4 áàéòà (float) â ìàøèííûé âèä</p> <p>2) ÷èñëî â ñòðîêîâîì âèäå ïåðåâåñòè â 8 áàéò (double) â ìàøèííûé âèä</p> <p>3) ÷èñëî â ìàøèííîì âèäå (float) ïåðåâåñòè â ñòðîêîâûé âèä (5 çíàêîâ ïîñëå çàïÿòîé).</p> <h2>Ïðèìåð</h2> <p>Ìû çíàåì ÷òî åñòü íåêîòîðîå ÷èñëî <b>float</b>, ñîõðàíåííîå â ìàøèííîì âèäå, íàïðèìåð <b>3fa00000</b>. ×òî áû óçíàòü êàê ýòî ÷èñëî áóäåò ñìîòðåòüñÿ â äåñÿòè÷íîì âèäå äåëàåì òàêèå äåéñòâèÿ:</p> <p>1) âêëþ÷àåì îïöèþ <b>float(dec,hex) -> str</b>, 2) ââîäèì òåêñò <b>0x3fa00000</b>, 3) íàæèìàåì <b>Ââîä</b> (â àíãë. âåðñèè <b>Ok</b>).</p> <p> ðåçóëüòàòå óçíàåì ÷òî ýòî ÷èñëî <b>1.25</b>:</p> <img src="str_do_opt3.png"> <p>Ðèñ. 1. Èñïîëüçîâàíèå îïöèè <b>float(dec,hex) -> str</b></p> </body> </html>