|
![](/i/fill.gif) |
Am 18.08.2013 15:23, schrieb Warp:
> clipka <ano### [at] anonymous org> wrote:
>> Am 18.08.2013 14:27, schrieb Warp:
>>> Orchid Win7 v1 <voi### [at] dev null> wrote:
>>>> But you can phrase that as
>>>
>>>> return x ? x : -x;
>>>
>>> No, you can't.
>>>
>>> Don't blame others for doing mistakes if you are doing them yourself. ;)
>
>> It's a creative way of writing "return x" though ;-)
>
> Out of curiosity: Does C#, like C/C++, consider a non-boolean value as
> a valid boolean (where a boolean is expected)?
Me I dunno. Though, thinking about it, Microsoft did various things
right with C#, so I suspect it won't accept non-booleans there.
> I know that there are some languages that don't, but on the other hand.
> C# is kind of in the C family of languages...
So is Java, but even that insists on proper booleans for tests.
Post a reply to this message
|
![](/i/fill.gif) |