|
![]() |
||||||||||||||
Primitive Data Types TutorialConversions to Bool TypeFunction asBool(x) converts any non-zero numerical value x to true and zero values to false. Function asBool(x) converts string values "true" and "T" to true, and each of other values to false. Source code:{# asBool( -3 ), asBool( 0 ), asBool( 2.1 ), asBool( 0.0 ), asBool( -3.2 ), asBool( "true" ), asBool( "True" ), // this is not same as "true" asBool( "T" ), asBool( "t" ) // this is not same se "T" #} Result:{# true, false, true, false, true, true, false, true, false #}
|
|
||||||||||||||
© 2006 Saša Malkov | |||||||||||||||