<div class="chatlog__message-group"> <div id="chatlog__message-container-323744585832595459" class="chatlog__message-container" data-message-id="323744585832595459"> <div class="chatlog__message"> <div class="chatlog__message-aside"><img class="chatlog__avatar" src="https://cdn.discordapp.com/avatars/293624673265123328/accd07acc220a18568ba46a6e9ede18a.png?size=512" alt="Avatar" loading="lazy"></div> <div class="chatlog__message-primary"> <div class="chatlog__header"><span class="chatlog__author" style="color:rgb(17,128,106)" title="koher" data-user-id="293624673265123328">koher</span> <a href="/channels/319688664240357376?category=main&channel=other-lang&message_id=323744773125177345"><span class="chatlog__timestamp" title="Monday, June 12, 2017 8:45 AM"></span></a><a href="#chatlog__message-container-323744585832595459">6/12/2017 8:45 AM</a></div> <div class="chatlog__content chatlog__markdown"><span class="chatlog__markdown-preserve">Python の <code class="chatlog__markdown-pre chatlog__markdown-pre--inline">round</code> が予想外の挙動なんですが何か知ってる人いませんか? <code class="chatlog__markdown-pre chatlog__markdown-pre--multiline language-python">>>> a = round(3.14) >>> print(a) 3 >>> type(a) <class 'int'> >>> b = round(np.float64(3.14)) >>> print(b) 3.0 >>> type(b) <class 'numpy.float64'></code></span></div> </div> </div> </div> <div id="chatlog__message-container-323744773125177345" class="chatlog__message-container" data-message-id="323744773125177345"> <div class="chatlog__message"> <div class="chatlog__message-aside"> <div class="chatlog__short-timestamp" title="Monday, June 12, 2017 8:46 AM">8:46 AM</div> </div> <div class="chatlog__message-primary"> <div class="chatlog__content chatlog__markdown"><span class="chatlog__markdown-preserve"> <div class="chatlog__markdown-quote"> <div class="chatlog__markdown-quote-border"></div> <div class="chatlog__markdown-quote-content">返り値は 1 引数で呼ばれたなら整数、そうでなければ number と同じ型です。 </div> </div><a href="https://docs.python.jp/3/library/functions.html#round">https://docs.python.jp/3/library/functions.html#round</a> </span></div> </div> </div> </div> </div>