Tus nqi siab tshaj ntawm ob npaug hauv Java yog dab tsi?
Tus nqi siab tshaj ntawm ob npaug hauv Java yog dab tsi?

Video: Tus nqi siab tshaj ntawm ob npaug hauv Java yog dab tsi?

Video: Tus nqi siab tshaj ntawm ob npaug hauv Java yog dab tsi?
Video: Tshuaj theem vim li cas thiaj tau nqi ?/ Siv kho mob dab tsi?/paris polyphylla use for? 2024, Kaum ib hlis
Anonim

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.

Raws li txoj cai, tus nqi max ntawm ob npaug yog dab tsi?

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.

Kuj Paub, 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.

Ib sab ntawm no, dab tsi yog ob npaug hauv Java?

A ob npaug yog IEEE754 ob npaug -precision floating point tooj, zoo ib yam li lub ntab tab sis nrog ntau qhov loj thiab qhov tseeb. IEEE754 ib tus lej precision muaj 32 khoom (1 kos npe, 8 exponent thiab 23 mantissa khoom) thaum ob npaug Cov lej muaj tseeb muaj 64 khoom (1 kos npe, 11 tus lej thiab 52 mantissa khoom).

Tus nqi max ntawm ntab hauv Java yog dab tsi?

luv luv: Cov ntaub ntawv luv luv yog 16-ntsis kos npe ob tus lej ntxiv. Nws muaj qhov tsawg kawg nkaus tus nqi ib., 32, 768 a tus nqi siab tshaj ntawm 32, 767 (suav nrog).

Default Tus nqi.

Hom ntaub ntawv Default Value (rau cov teb)
ntab 0,0f ua
ob npaug 0.0d ib
char 'u0000'
Txoj hlua (los yog tej yam khoom) null

Pom zoo: