<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[beginstrong的博客]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/beginstrong</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; beginstrong]]></copyright><item><title><![CDATA[leetcode166:分数到小数]]></title><link>https://blog.csdn.net/beginstrong/article/details/120597092</link><guid>https://blog.csdn.net/beginstrong/article/details/120597092</guid><author>beginstrong</author><pubDate>Sun, 03 Oct 2021 18:56:10 +0800</pubDate><description><![CDATA[题目描述如下：



leetcode 166:分数到小数



题目类型：数学题

题目特点：运算越界问题-&gt;(转化成更大类型的数、转化成字符串）、结果的正负值等零散边界值的考虑。

题目思路：运用模拟的思路，既然是相除，因此结果值可能是（整数、整数+小数），结果值也有可能是负值。

边界考虑一：先转成long类型，避免数值越界问题。



考虑二：可以整除，直接返回结果。



考虑三：结果为负数，什么时候结果为负数？其中有一个为负值，被除数&lt;0^除数&lt;0。



考虑四：先...]]></description><category></category></item></channel></rss>