Top "Boolean" questions

A Boolean data type is a data type with only two possible values: true or false.

Is sizeof(bool) defined in the C++ language standard?

I can't find an answer in the standard documentation. Does the C++ language standard require sizeof(bool) to always be 1 (…

c++ boolean sizeof implementation-defined-behavior
How to fire jQuery function only if form is valid

I have a jQuery function tied to my submit button like this: $(function () { $('#signupform').submit(function () { alert('test'); }); }); However, …

javascript jquery boolean unobtrusive-validation
Why 0 is true but false is 1 in the shell?

false; echo $? The above will output 1, which is contradictory with all other programming languages I know. Any reason in this?

shell boolean
How to use radio button correctly in rails?

I'm trying to create some radio buttons and I'm not sure how to. Following this question I've got it set …

ruby-on-rails radio-button boolean
C++ : why bool is 8 bits long?

In C++, I'm wondering why the bool type is 8 bits long (on my system), where only one bit is enough …

c++ boolean size
Checking the value of an Optional Bool

When I want to check if an Optional Bool is true, doing this doesn't work: var boolean : Bool? = false if …

swift boolean optional
Spring @RequestParam mapping Boolean based on 1 or 0 instead of true or false

Why is Spring 3.2 only mapping my Boolean based on that the requestparam is "0" or "1" ? @RequestParam(required= false, defaultValue = "false") Boolean …

spring request boolean http-request-parameters
Fastest way to generate a random boolean

So there is several ways of creating a random bool in C#: Using Random.Next(): rand.Next(2) == 0 Using Random.NextDouble(): …

c# performance random boolean
C99 boolean data type?

What's the C99 boolean data type and how to use it?

c types boolean c99
How do I submit a boolean parameter in Rails?

I'm submitting a parameter show_all with the value true. This value isn't associated with a model. My controller is …

ruby-on-rails parsing parameters boolean