Dab tsi yog tus nqi max ntawm ob?
Dab tsi yog tus nqi max ntawm ob?

Video: Dab tsi yog tus nqi max ntawm ob?

Video: Dab tsi yog tus nqi max ntawm ob?
Video: Kev hlub quav tshuaj-LOKY(Official MV ) 2024, Kaum ib hlis
Anonim

Qhov loj tshaj / loj tshaj plaws integer uas tuaj yeem khaws cia rau hauv a ob npaug tsis poob precision yog tib yam li cov loj tshaj plaws ua tau tus nqi ntawm ib ob . Ntawd yog, DBL_MAX lossis kwv yees li 1.8 × 10308 (yog koj ob npaug yog IEEE 754 64-ntsis ob npaug ). Nws yog integer. Nws yog sawv cev raws nraim.

Xav txog qhov no, tus nqi max ntawm ob npaug hauv Java yog dab tsi?

MAX_VALUE yog tus nqi siab tshaj a ob npaug tuaj yeem sawv cev (qhov chaw nyob ib puag ncig 1.7 * 10^308). Qhov no yuav tsum xaus rau hauv qee qhov teeb meem kev suav, yog tias koj sim rho tawm siab kawg ua tau tus nqi ntawm ib hom ntaub ntawv.

Tsis tas li ntawd, ob tus nqi yog dab tsi? Cov ob npaug sib txawv tuaj yeem tuav tus lej loj (lossis me me). Qhov siab tshaj plaws thiab yam tsawg kawg nkaus tus nqi yog 17 raws li 307 zeros. Cov ob npaug kuj tseem siv tau los tuav cov ntsiab lus ntab tus nqi . Ib tug floating point tus nqi yog ib yam li 8.7, 12.5, 10.1. Hauv lwm lo lus, nws muaj "ko taw ib yam dab tsi" thaum kawg.

Ntawm no, tus nqi siab tshaj ntawm ob npaug hauv C ++ yog dab tsi?

Nws teev qhov tsawg kawg nkaus thiab tus nqi siab tshaj plaws a ob npaug tuaj yeem tuav hauv C++ raws li -1.7 * 10 ^ 308 thiab 1.7 * 10 ^ 308, ntsig txog.

Float max nqi yog dab tsi?

Ib leeg-precision ntab -point hom ntawv. Ib qho kos npe 32-ntsis tus lej sib txawv muaj ib tus nqi siab tshaj ntawm 231 - 1 = 2, 147, 483, 647, whereas IEEE 754 32-ntsis base-2 ntab -point variable muaj a tus nqi siab tshaj ntawm (2-223) × 2127 ≈ 3.4028235 × 1038.

Pom zoo: