Dab tsi yog hom logical?
Dab tsi yog hom logical?

Video: Dab tsi yog hom logical?

Video: Dab tsi yog hom logical?
Video: Yog hmoov dab tsi - Gao Nou Kue ft. Mang Vang (Official Music Video) New song 2020 2024, Kaum ib hlis
Anonim

Cov Logical Cov ntaub ntawv Hom yog cov ntaub ntawv tshwj xeeb hom rau cov ntaub ntawv nrog tsuas yog ob qhov txiaj ntsig tau. Cov txiaj ntsig no tuaj yeem txhais tau tias yog 0/1, tseeb / cuav, yog / tsis yog, thiab lwm yam Logical Cov ntaub ntawv Hom tsuas yog xav tau ib qho me ntsis cia. Rau ib leeg Logical teb, sab laug-feem ntau (high-order) me ntsis yog siv.

Yog li ntawd, nws txhais li cas kom muaj kev xav?

Logical piav txog tej yam uas los ntawm kev xav paub meej. Lub adjective logical yog rooted nyob rau hauv Greek lo lus logos, uas txhais tau tias "yog vim li cas, lub tswv yim, los yog lo lus." Yog li hu ib yam dab tsi logical txhais tau tias nws yog raws li qhov laj thawj thiab lub tswv yim zoo - hauv lwm lo lus, xav tawm nrog kev ua lej thiab tshem tawm ntawm kev xav.

Tom qab ntawd, lo lus nug yog, nws puas muaj tseeb 0 lossis 1? 1 yog suav tias yog qhov tseeb vim nws tsis yog xoom. Qhov thib plaub qhia muab a tus nqi ua 0i. 0 yog suav tias yog cuav.

Kuj tseem yuav paub, dab tsi yog qhov sib txawv ntawm qhov sib txawv hauv C?

Nco ntsoov tias ob lub sijhawm nyob ib puag ncig TRUE thiab FALSE yuav tsum nyob ntawd; txwv tsis pub, lawv dhau los ua tus cim. A sib txawv uas tuaj yeem tuav ib qho ntawm logical qhov tseem ceeb yog a logical variable thiab nws yog hom LOGICAL . Tshaj tawm a LOGICAL sib txawv , ua raws li qhov koj tau ua rau INTEGER thiab REAL sib txawv.

0 txhais li cas hauv Boolean?

C ua tsis muaj boolean hom ntaub ntawv, thiab ib txwm siv cov lej rau boolean kuaj. Zero yog siv rau sawv cev cuav, thiab ib tug yog siv rau sawv cev muaj tseeb. Rau kev txhais lus, Xoom txhais tau tias yog cuav thiab txhua yam uas tsis yog xoom yog txhais raws li qhov tseeb.

Pom zoo: