View Single Post
  #93   Report Post  
Posted to uk.d-i-y
The Natural Philosopher[_2_] The Natural Philosopher[_2_] is offline
external usenet poster
 
Posts: 39,563
Default What is two + two?

On 12/04/18 22:51, Tim Streater wrote:
In article , bert wrote:

In article 20180411225333.1c2bfa57@Mars, Rob Morley
writes
On Sun, 8 Apr 2018 09:50:04 +0100
ARW wrote:

Four?

Nope it is 4.

Just had to prove that I was a human to send off a submission on a
website and that was their question and answer.

Anyone else agree that the answer is four and not 4?

If those are strings rather than numbers then + is the concatenation
operator and the result is twotwo

That too.


Not in PHP where the concatenation operator is a .

What about javascript?

That is the worst of the lot as I discovered...

2+2 = 4 if and only if they are *interpreted as numbers*.

2+2 could in fact be 22...

This is the nightmare of weakly typed computer languages designed so
that idiot programmers dont have to think...with two different
implementations which differ...in my case IE6 and Firefox gave different
results...

Or go the other way to e.g. Pascal that is SO inflexible that you cant
change e.g. a sector block of data into an array of bits so that you can
exmione its headers, a set of strings to look at its data...etc
etc..without predefining a union of every single possible arrangements
of bits that it might be.

Thank Clapton for C, where you can force the compiler to understand that
although you declared it as a string, you now want to access it as a
bitfield instead..

so

char *x="Hello world";

return x[4]&32;

is a valid syntax;









--
Any fool can believe in principles - and most of them do!