第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

Python 轉(zhuǎn)換皮秒和飛秒沒(méi)有以秒為單位給出正確的時(shí)間

Python 轉(zhuǎn)換皮秒和飛秒沒(méi)有以秒為單位給出正確的時(shí)間

瀟瀟雨雨 2022-11-29 17:05:08
I'm converting from all units of time to seconds and for some reason with the smaller units of time (picoseconds and femtoseconds), i'm getting (femtoseconds): 0.00000000000000100000000000000007770539987666107923830718560119501514549256171449087560176849365234375 instead of 0.000000000000001.有誰(shuí)知道為什么?days = int(input("Enter the amount of days: ")) * 24 * 60 * 60hours = int(input("Enter the amount of hours: ")) * 60 * 60minutes = int(input("Enter the amount of minutes: ")) * 60ms = int(input("Enter the amount of milliseconds: ")) * (10 ** -3)mcs = int(input("Enter the amount of microseconds: ")) * (10 ** -6)ns = int(input("Enter the amount of nanoseconds: ")) * (10 ** -9)ps = int(input("Enter the amount of picoseconds: ")) * (10 ** -12)fs = int(input("Enter the amount of femtoseconds: ")) * (10 ** -15)s = days + hours + minutes + ms + mcs + ns + ps + fsprint("The amount of seconds is:", "{0:.50}".format(s))
查看完整描述

1 回答

?
手掌心

TA貢獻(xiàn)1942條經(jīng)驗(yàn) 獲得超3個(gè)贊

浮點(diǎn)數(shù)無(wú)法用任何編程語(yǔ)言準(zhǔn)確表示,原因很簡(jiǎn)單,因?yàn)楦↑c(diǎn)數(shù)的數(shù)量是無(wú)限的。但是,可能對(duì)您有幫助的是DecimalClarification on the Decimal type in Python

文檔:https ://docs.python.org/3.8/library/decimal.html


查看完整回答
反對(duì) 回復(fù) 2022-11-29
  • 1 回答
  • 0 關(guān)注
  • 148 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)