7
Related: I double the source, you double the output!
When Steve Jobs launched the iPhone 3G, the slogan said
Twice as fast, half the price
I changed the word fast to long to better represent this challenge.
Objective
Write a program that outputs a non-zero, even integer. If the source code is doubled, the value of the output must be cut off by half.
To double the source in a Unix shell (with Core Utilites):
cat source.txt source.txt > doubled-source.txt
Rules & Requirements
Now the requirement has changed and the task has been even more challenging!
- You must build a full program.
- The initial source is no longer required to be at least 1 byte long. An empty program qualifies as long as the output is correct.
- Both the integers must be in base 10 (outputting them in any other base or with scientific notation is forbidden), and must not be zero. The integer is no longer required to be positive, so if you like a negative number, it's OK.
- Your program must not take input (or have an unused, empty input) and must not throw any error (compiler warnings are not considered errors). Exit code must be zero.
- Outputting the integers with trailing / leading spaces / newlines is allowed, as long as only one integer is output.
- You can't assume a newline between copies of your source. If you need one, clarify it. See the Unix shell command above.
- Standard loopholes are forbidden.
Because this is a code-golf, the shortest (original, undoubled) code in each language wins!
Extras
Please give description / explanation to your code if possible.
Must the old and new program be in the same language? – tsh – 2017-08-29T04:03:12.323
@tsh Definitely – iBug – 2017-08-29T04:10:55.520
2By the way, zero byte answers to this question can't exist. – Joshua – 2017-08-29T04:20:42.450
1@WheatWizard This is exactly the opposite. – Arthur – 2017-08-29T06:42:49.017
@Arthur That is somewhat true but also misleading. The only difference between this question and that is the operation involved. I consider this a rather minor difference that doesn't add anything not already present in the original. – Post Rock Garf Hunter – 2017-08-29T06:45:48.810