text:
Circle Maze Checker
You know those wooden toys with little ball bearings where the object is to move around the maze? This is kinda like that. Given a maze and a series of moves, determine where the ball ends up.
The board is held vertically, and the ball moves only by gravity when the board is rotated. Each "move" is a rotation (in radians).
The maze is simply concentric circular walls, with each wall having exactly one opening into the outer corridor, similar to this (assume those walls are circles and not pointed):

As you can see, the ball starts in the middle and is trying to get out. The ball will instantly fall through as soon as the correct orientation is achieved, even if it's midway through a rotation. A single rotation may cause the ball to fall through multiple openings. For instance, a rotation >= n * 2 * pi is enough to escape any maze.
For the purposes of the game, a ball located within 0.001 radians of the opening is considered a "fit", and will drop through to the next corridor.
Input:
Input is in two parts:

The maze is given by an integer n representing how many walls/openings are in the maze. This is followed by n lines, with one number on each, representing where the passage to the next corridor is.
The moves are given as an integer m representing how many moves were taken, followed (again on separate lines) by m clockwise rotations of the board in radians (negative is anticlockwise).

All passage positions are given as 0 rad = up, with positive radians going clockwise.
For the sample image above, the input may look like this:
7                        // 7 openings
0
0.785398163
3.14159265
1.74532925
4.71238898
4.01425728
0
3                        // 3 moves
-3.92699082
3.14159265
0.81245687

Output:
Output the corridor number that the ball ends in. Corridors are zero-indexed, starting from the center, so you start in 0. If you pass through one opening, you're in corridor 1. If you escape the entire maze, output any integer >= n
For the sample input, there are three moves. The first will cause the ball to fall through two openings. The second doesn't find an opening, and the third finds one. The ball is now in corridor 3, so expected output is:
3

Behavior is undefined for invalid input. Valid input is well-formed, with n >= 1 and m >= 0.
Scoring is standard code golf, lowest number of bytes wins. Standard loopholes are forbidden. Input must not be hard-coded, but can be taken from standard input, arguments, console, etc. Output can be to console, file, whatever, just make it output somewhere visible.

"Behavior is undefined for invalid input." <<-- This needs to be put in all puzzles!

In that hypothetical case, you could also calculate π whenever needed with variable accuracy, raising the accuracy until it is sufficient to tell whether a ball has fallen or not. A problem I have with the tolerance for a fit (or at least its current wording) is if A) consecutive fits are closer than 0.001 to each other such that the ball only falls two levels if the tolerance is taken into account B) when the ball is within 0.001 of a hole, it jumps to the hole (if you really want to read something into the wording).

@Wrzlprmft The ball doesn't jump to the hole. Think of the threshold as meaning that the holes are slightly wider than the ball. It still drops through to the same location, just one level further. If you imagine the threshold was 1, you'd just be working with large holes, not jumping balls to the center of the hole when they fall.

Why is the input in such an inconvenient format? I'm pretty sure I've golfed entire programs shorter than what I need to read it :/

Perl, 211 191
With newlines and indentation for readability:
$p=atan2 0,-1;
@n=map~~<>,1..<>;
<>;
while(<>){
    $_=atan2(sin,cos)for@n;
    $y=abs($n[$-]+$_)<$p-.001
        ?$_
        :($_<=>0)*$p-$n[$-];
    $_+=$y for@n;
    $p-.001<abs$n[$-]&&++$-==@n&&last;
    $_-=$y;
    .001<abs&&redo
}
print$-

Number of moves in the input is discarded, stdin's eof indicates end of moves.

JavaScript 200
function f(i){with(Math)for(m=i.split('\n'),o=m.slice(1,t=+m[0]+1),m=m.slice(t+1),c=PI,p=2*c,r=0,s=1e-3;m.length;c%=p)abs(c-o[r])<s?r++:abs(t=m[0])<s?m.shift(c+=t):(b=t<0?-s:s,c+=p-b,m[0]-=b);return r}

EDIT : Here is an animated example proving that this solver works :  http://jsfiddle.net/F74AP/4/

The function must be called passing the input string.
Here is the call of the example given by the OP :
f("7\n0\n0.785398163\n3.14159265\n1.74532925\n4.71238898\n4.01425728\n0\n3\n-3.92699082\n3.14159265\n0.81245687");

It returns 3 as intended.

From the challenge, "...input must not be hard-coded...".  Unless I am mistaken, that means you have to read it in, and you also have to have a complete program. This looks like just a function.

I don't understand, the values are not hard-coded ! "...Input must not be hard-coded, but can be taken from standard input, arguments, console, etc.". Concerning the complete program, I don't see where it is specified and anyway, IMO this is a complete JS solution.

I didn't specify a full program, so I see no problem with a function only. However, input is specified as being separated by newlines, not already arranged into native arrays. That should be simple to satisfy.

@Geobits, I will modify it later, have a look at this fiddle : http://jsfiddle.net/F74AP/1/

After watching the animation, I can see that you rotate the wrong way. Positive rotations rotate should the board clockwise, where yours rotate clockwise for negative. Still gives 3 for this input, but would be off for others.

@Geobits, right ! Simple sign error... Fixed ;-)


text:
How much can you quickly multiply?
With the recent Python bashing, here's an attempt to show Python's strengths.
Your challenge is to write a program that calculates the factorial of as high a number n as possible within 10 seconds.
Your score will be (highest n for your program on your machine)/(highest n for my program on your machine)
Rules

You must calculate an exact integer solution. Since the factorial would be much higher than what can fit in a 64 bit unsigned integer, you can use strings if your language does not support large integers
Standard loopholes are forbidden. Particularly, you cannot use any external resources.
Only the calculation part(this includes time for any workarounds using strings) adds to the total time which should be under 10 seconds on average.
Single threaded programs only.
You must store the output in an easily printable form (as printing takes time) (see my program below), string, variable, character array, etc.

EDIT:

Your program must give the correct output for all n: 1 <= n <= (your highest n)

EDIT2:

I hate to say this explicitly but using your language's built-in factorial functions falls under the standard loopholes http://meta.codegolf.stackexchange.com/a/1078/8766
Sorry Mathematica and Sage

My program
from __future__ import print_function
import time

def factorial( n ):
    return reduce( ( lambda x , y : x * y ) , xrange( 1 , n + 1 ) , 1 )

start = time.clock()
answer = factorial( 90000 )
end = time.clock()

print ( answer )
print ( "Time:" , end - start , "sec" )

Highest score wins.
For the record, my code can manage n = 90000 in about 9.89 seconds on a Pentium 4 3.0 GHz

EDIT: Can everyone please add the score rather than just the highest n. Just the highest n has no meaning by itself as it depends on your hardware. It's impossible to have an objective winning criterion otherwise. ali0sha's anwer does this correctly.

We have a winner. I didn't accept the java answer https://codegolf.stackexchange.com/a/26974/8766 as it kind of skirts close to http://meta.codegolf.stackexchange.com/a/1080/8766

You can use operator.mul instead of the lambda function

You should probably add that print([1, 2, 6, 10, 50, 120, ...][n]) is invalid.

Bit suprised this works, but assuming I read the rules correctly this MATLAB solution would be nice: factorial(Inf), returns Inf in a fraction of a second.

Is my assumption that you are looking for an answer in [python] correct?

@Doorknob That fits in the standard loopholes.

@DennisJaheruddin, it's a bit of a stretch to refer to "Inf" as an "exact integer solution".

How is bigint math a "strength" of Python? It doesn't even use GMP.

@Quincunx No, any language is allowed.

@NiklasB. "It doesn't even use GMP."--I just used the simplest code so that others can make it more efficient

@user80551 I was referring to your statement "here's an attempt to show Python's strengths", because this is clearly not a task where Python can shine (unless you use bindings to non-standard libraries). Still a valid challenge, of course :)

@NiklasB. Hence the word attempt, Do you want me to change it to lame attempt or something?

http://cs.stackexchange.com/questions/14456/factorial-algorithm-more-efficient-than-naive-multiplication

@NiklasB. C/C++ don't even have a bigint class at all. In fact python's bigints are quite fast compared to other bigints implementations (I believe F# is about 3 times slower from a comment I receive some day ago...) If you want to include languages that can load/import a bigint implementation, so can python. In summary: I don't see the point of your comment.

@Bakuriu Sure, but Ruby, Haskell or other languages that use GMP by default will beat it hands down. Although I admit that my comment was lacking a proper point :) Nevermind

@NiklasB. Are you sure? Because on my machine Haskell is about tens of times slower at computing factorials... In fact I get a stackoverflow with the factorial of 1000000. Python's built-in math.factorial computes it without problems in about 12 seconds.

@Bakuriu Interesting, I can reproduce that. Seems like Python 3 is about 10 times faster than Python 2.7, nice. I will definitely shut my mouth now :) Not sure why Haskell is so slow actually

Oh god you seriously implemented this with a reduce and a lambda? Really really inefficient even for python.

@Claudiu See my previous comment to Niklas B. , I just used the simplest method that came to my mind and didn't bother optimizing. Optimizing the code is part of the challenge.

Could the down-voter please explain what's wrong with the question?

How can someone measure the correct score if they're using a much more powerful CPU than you?

I really wished that someone would provide a creative solution with bitshifts and lots of recursion.

C++ with GMP, score = 55.55 (10,000,000 / 180,000)
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <vector>
#include <iostream>
#include <queue>
#include <gmpxx.h>

int main(int argc, char *argv[]) {
  uint64_t n = atoi(argv[1]);

  // Iterate through 1..n.  Strip off powers of 2.  Multiply
  // remainders together into <= 64 bit chunks.
  uint64_t twos = 0;
  std::vector<uint64_t> terms;
  uint64_t m = 1;
  for(uint64_t i = 1; i <= n; i++) {
    uint64_t j = __builtin_ctzll(i);
    twos += j;
    uint64_t k = i >> j;
    if(__builtin_clzll(m) + __builtin_clzll(k) >= 64) {
      m *= k;
    } else {
      terms.push_back(m);
      m = k;
    }
  }
  if(m != 1) terms.push_back(m);

  // convert to gmp
  // why isn't there a 64-bit constructor?
  std::queue<mpz_class> gmpterms;
  for(int i = 0; i < terms.size(); i++) {
    mpz_class x = (uint32_t)(terms[i] >> 32);
    x <<= 32;
    x += (uint32_t)terms[i];
    gmpterms.push(x);
  }

  // pop two from the bottom, multiply them, push on the end.
  while(gmpterms.size() > 1) {
    mpz_class a = gmpterms.front();
    gmpterms.pop();
    mpz_class b = gmpterms.front();
    gmpterms.pop();
    gmpterms.push(a * b);
  }

  mpz_class r = gmpterms.front();
  r <<= twos;
  //std::cout << r << std::endl;
}

Python 2.7
42.575 = ( 6,812,000 / 160,000 ) approx

Code:
import gmpy2

def fac1(n):
    m=lambda(L):([]if len(L)%2==0 else[L.pop()])+map(lambda(l):l[0]*l[1],zip(L[1::2],L[-2::-2]))
    L=map(gmpy2.mpz,xrange(1,n+1))
    Number = (len(L)-1).bit_length()
    while Number:Number-=1;L=m(L)
    return L[0]

def fac2(n):
    global E; E=0
    def f(i):
        global E; E+=i//2
        return[]if i==1 else f(i//2)+range(3,i,2)+[[1,i][i%2]]
    m=lambda(L):([]if len(L)%2==0 else[L.pop()])+map(lambda(l):l[0]*l[1],zip(L[1::2],L[-2::-2]))
    L=map(gmpy2.mpz,f(n))
    N=(len(L)-1).bit_length()
    while N: N-=1;L=m(L)
    return L[0]<<E

Test:
import time

start = time.time()
baseline(160000)
print time.time()-start

start = time.time()
fac1(6811000)
print time.time()-start

start = time.time()
fac2(6812000)
print time.time()-start

start = time.time()
gmpy2.fac(26000000)
print time.time()-start

Output:
10.0069999695
10.0729999542
10.0360000134
9.98699998856

How it works:
Bigger multiplications take more time, thus we want to do as many small multiplications as possible. This is especially true in Python where for numbers less that 2^64 we use hardware arithmetic, and above that we use software. So, in m(L), we start with a list L; if it's odd length we remove one number from consideration to make it even again. Then we multiply element 1 with element -2, element 3 with -4, etc, so that
m([1,2,3,4,5,6,7,8]) = [2*7, 4*5, 6*3, 8*1] = [14, 20, 18, 8]
m([10,12,6]) = [360,112]
m([120,6]) = [40320]

This approach ensures we're using hardware arithmetic for as long as possible, following which we switch onto the efficient gmc arithmetic library.
In fac2, we take a more classic divide and conquer approach as well, where we split out every multiple of 2 and bitshift them at the end for a trivial performance boost. I've included it here because it's usually around 0.5% faster than fac1.
Golfed Version of fac1 (because I can), 220B
import gmpy2
def f(n):
    m=lambda(L):([]if len(L)%2==0 else[L.pop()])+map(lambda(l):l[0]*l[1],zip(L[1::2],L[-2::-2]))
    L=map(gmpy2.mpz,xrange(1,n+1));N=(len(L)-1).bit_length()
    while N:N-=1;L=m(L)
return L[0]

If the GMP backend includes a bitshift function then you can keep the numbers even smaller by dividing each number in the list by 2 until it's even and then doing a single shift at the end.

Where did you get gmpy2 from?  $ python
Python 2.7.3 (default, Feb 27 2014, 19:58:35)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

from gmpy2 import mpz
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named gmpy2

@user80551: https://code.google.com/p/gmpy/ (the top google search result) has installers for many different platforms.

For the golfed version, couldn't you do while len(L): ... instead of while len(L)>1: ...?

No: the function inside that loop will never take the list below length 1 and anyhow we need the first element!

Java - 125.15 (21,400,000 / 171,000)
Also shamelessly copied from Peter Luschny's Github repo (thanks @semi-extrinsic) and licensed under the MIT license, this uses the "prime factorization nested squaring" algorithm as proposed by Albert Schönhage et al. (according to Luschny's factorial algorithms description page).
I slightly adapted the algorithm to use Java's BigInteger and to not use a lookup table for n < 20.
Compiled with gcj, which uses GMP for its BigInteger implementation, and ran on Linux 3.12.4 (Gentoo), on a Core i7 4700MQ at 2.40GHz
import java.math.BigInteger;

public class PrimeSieveFactorialSchoenhage {

    private static int[] primeList, multiList;

    public static BigInteger factorial(int n) {
        int log2n = 31 - Integer.numberOfLeadingZeros(n);
        int piN = log2n < 2 ? 1 : 2 + (15 * n) / (8 * (log2n - 1));

        primeList = new int[piN];
        multiList = new int[piN];

        int len = primeFactors(n);
        return nestedSquare(len).shiftLeft(n - Integer.bitCount(n));
    }

    private static BigInteger nestedSquare(int len) {
        if (len == 0) {
            return BigInteger.ONE;
        }

        int i = 0, mult = multiList[0];

        while (mult > 1) {
            if ((mult & 1) == 1) { // is mult odd ?
                primeList[len++] = primeList[i];
            }

            multiList[i++] = mult / 2;
            mult = multiList[i];
        }
        BigInteger ns = nestedSquare(i);
        if (len <= i) {
            return ns.multiply(ns);
        }

        return product(primeList, i, len - i).multiply(ns.multiply(ns));
    }

    private static BigInteger product(int[] a, int start, int length) {
        if (length == 0) {
            return BigInteger.ONE;
        }

        int len = (length + 1) / 2;
        long[] b = new long[len];

        int i, j, k;

        for (k = 0, i = start, j = start + length - 1; i < j; i++, k++, j--) {
            b[k] = a[i] * (long) a[j];
        }

        if (i == j) {
            b[k++] = a[j];
        }

        return recProduct(b, 0, k - 1);
    }

    private static BigInteger recProduct(long[] s, int n, int m) {
        if (n > m) {
            return BigInteger.ONE;
        }
        if (n == m) {
            return BigInteger.valueOf(s[n]);
        }
        int k = (n + m) >> 1;
        return recProduct(s, n, k).multiply(recProduct(s, k + 1, m));
    }

    private static int primeFactors(int n) {
        int[] primes = new int[n < 17 ? 6 : (int) Math.floor(n / (Math.log(n) - 1.5))];
        int numPrimes = makePrimeList(n, primes);

        int maxBound = n / 2, count = 0;

        int start = indexOf(primes, 2, 0, numPrimes - 1);
        int end = indexOf(primes, n, start, numPrimes);

        for (int i = start; i < end; i++) {
            int prime = primes[i];
            int m = prime > maxBound ? 1 : 0;

            if (prime <= maxBound) {
                int q = n;
                while (q >= prime) {
                    m += q /= prime;
                }
            }

            primeList[count] = prime;
            multiList[count++] = m;
        }
        return count;
    }

    private static int indexOf(final int[] data, int value, int low, int high) {
        while (low < high) {
            int mid = (low + high) >>> 1;

            if (data[mid] < value) {
                low = mid + 1;
            } else {
                high = mid;
            }
        }

        if (low >= data.length) {
            return low;
        }

        if (data[low] == value) {
            low++;
        }

        return low;
    }

    private static int makePrimeList(int n, int[] prime) {
        boolean[] composite = new boolean[n / 3];

        sieveOfEratosthenes(composite);

        boolean toggle = false;
        int p = 5, i = 0, j = 2;

        prime[0] = 2;
        prime[1] = 3;

        while (p <= n) {
            if (!composite[i++]) {
                prime[j++] = p;
            }
            // -- never mind, it's ok.
            p += (toggle = !toggle) ? 2 : 4;
        }

        return j; // number of primes
    }

    private static void sieveOfEratosthenes(final boolean[] composite) {
        int d1 = 8;
        int d2 = 8;
        int p1 = 3;
        int p2 = 7;
        int s1 = 7;
        int s2 = 3;
        int n = 0;
        int len = composite.length;
        boolean toggle = false;

        while (s1 < len) { // -- scan sieve
            if (!composite[n++]) { // -- if a prime is found, cancel its multiples
                int inc = p1 + p2;

                for (int k = s1; k < len; k += inc) {
                    composite[k] = true;
                }

                for (int k = s1 + s2; k < len; k += inc) {
                    composite[k] = true;
                }
            }

            if (toggle = !toggle) { // Never mind, it's ok.
                s1 += d2;
                d1 += 16;
                p1 += 2;
                p2 += 2;
                s2 = p2;
            } else {
                s1 += d1;
                d2 += 8;
                p1 += 2;
                p2 += 6;
                s2 = p1;
            }
        }
    }

    public static void main(String[] args) {
        int n = Integer.parseInt(args[0]);
        long nanos = System.nanoTime();
        BigInteger fact = factorial(n);
        nanos = System.nanoTime() - nanos;
        // Commented out because it takes ages to print
        //System.out.println(fact);
        System.out.println(nanos / 1e9);
    }
}

Compiled with gcj -O3 --main=PrimeSieveFactorialSchoenhage PrimeSieveFactorialSchoenhage.java -o pf_nest_square_fact

Perl + C, n = about 3 million
Here I'm using the Math::BigInt::GMP library available on CPAN, which provides a massive speed boost for Perl's core Math::BigInt objects.
use v5.14;
use Time::HiRes 'time';
use Math::BigInt only => 'GMP';

sub factorial { Math::BigInt::->new(@_)->bfac }

my $start  = time;
my $answer = factorial( 3_000_000 );
my $end    = time;

say $answer;
say "Time: ", $end - $start, " sec";

Bear in mind that my computer is probably quite a bit slower than yours. Using your original Python script, I can only calculate factorial(40000) in 10 seconds; factorial(90000) takes a lot longer. (I hit Ctrl+C after a minute.) On your hardware, using Math::BigInt::GMP, you may well be able to calculate the factorial of 5 million or more in under 10 seconds.
One thing you may notice is that although the factorial is calculated incredibly quickly, printing out the result is very slow, taking about three times longer than the original calculation. This is because GMP internally uses a binary rather than decimal representation, and printing it out requires binary to decimal conversion.

I think GMP counts as an external resource. (Although it certainly makes things a hell of a lot easier than implementing prime factorization and Schönhage-Strassen multiplication from scratch.)

I was assuming that "external resource" referred to looking up solutions from a pre-computed set of answers in a database, or a web service, etc.

Squeamish: libraries don't normally count as external resources unless they have a function which falls under the boring loopholes rule.

Tobyink: can you explain what your program does? it looks like you're just using a built-in function (bfac?)

Yup. This answer is invalid, since it uses the factorial method of Math::BigInt

Firstly, that rule was added after I'd written my answer. Secondly, Math::BigInt isn't a "built-in factorial function". Math::BigInt is bundled with Perl, but not built into it any more than Net::FTP, IO::Compress::Gzip, or Digest::MD5.

Tobyink: we're supposed to be writing a factorial function, not using an existing one... using a library function falls under standard loopholes (see other discussions)

Python 2.7
5.94 = 1'200'000/202'000
def fast_fac(n):
    def prod(start, fin):
            if fin - start <= 50:
                    return reduce(lambda x,y: x*y, xrange(start, fin+1), 1)
            else:
                    mid = (start+fin) / 2
                    return prod(start, mid) * prod(mid+1, fin)
    return prod(1, n)

Makes use of relative ease of multiplication of many groups of small numbers and then multiplying them compared to large number of multiplyings involving huge number.

bc, score=0.19
What the heck, here's my contender for "How much can you slowly multiply?"
bc is "An arbitrary precision calculator language", but unfortunately rather slow:
n=read()
for(f=i=1;i<=n;i++)f*=i
f
quit

In about 10 seconds on my mid 2012 MacBook Pro (2.3 GHz Intel Core i7) the reference python answer can calculate 122000!, but this bc script can only calculate 23600!.
Conversely 10000! takes 1.5s with the python reference script, but the bc script takes 50s.
Oh dear.

OpenBSD bc(1) is faster. Your program scores 0.29 = 28000/98000. There is no read(), so I ran time sed 's/read()/28000/' factorial.bc | bc.

Bash: score = 0.001206  (181/150000)
I stole the math functions from Rosettacode - Long multiplication
I didn't analyzed nor tried to optimize.
You are free to change the algorithm or to try a different strings split method.
#!/bin/bash

add() { # arbitrary-precision addition
  if (( ${#1} < ${#2} )); then
    local a="$2" b="$1" sum= carry=0
  else
    local a="$1" b="$2" sum= carry=0
  fi

  while (( ${#a} )); do
    local -i d1="${a##${a%?}}" d2="10#0${b##${b%?}}" s=carry+d1+d2
    sum="${s##${s%?}}$sum"
    carry="10#0${s%?}"
    a="${a%?}" b="${b%?}"
  done
  echo "$sum"
}

multiply() { # arbitrary-precision multiplication
  if (( ${#1} < ${#2} )); then
    local a="$2" b="$1" product=0
  else
    local a="$1" b="$2" product=0
  fi

  local zeroes=
  while (( ${#b} )); do
    local m1="$a"
    local m2="${b##${b%?}}"
    local partial=$zeroes
    local -i carry=0
    while (( ${#m1} )); do
      local -i d="${m1##${m1%?}}"
      m1="${m1%?}"
      local -i p=d*m2+carry
      partial="${p##${p%?}}$partial"
      carry="10#0${p%?}"
    done
    partial="${carry#0}$partial"
    product="$(add "$product" "$partial")"
    zeroes=0$zeroes
    b="${b%?}"
  done
  echo "$product"
}

# 'timerun' function
trap 'echo $((i -1)) $f; exit'  USR1
(sleep 9.9; kill -USR1 $$)&

declare -i i
f=1
for ((i=1; i< 10000 ; i++ ))   # 10000 is verry optimistic
do
    f=$(multiply $f $i)
done

Please add the score and not just the highest n

@user80551 it's done

C++ (x86_64-specific) - 3.0 (390000/130000)
(easily portable to x86-32, porting to other architectures implies a significant speed loss)
Here's my own micro-implementation of long arithmetic.
The calculation itself takes 10 seconds, and while the output is in easily printable form (see the operator<< overload), it takes some more time to print it.
#include <vector>
#include <iostream>
#include <stdint.h>
#include <ctime>

typedef uint64_t digit;
typedef std::vector<digit> number;

std::ostream &operator<<(std::ostream &s, const number &x)
{
    std::vector<char> o;
    size_t size = x.size() * 21;
    o.resize(size);
    size_t lud = 0;
    for(number::const_reverse_iterator i = x.rbegin(), end = x.rend(); i != end; i++)
    {
        digit carry = 0;
        int j;
        for(j = 0; j <= lud || carry; j++)
        {
            digit r = o[j] * (1LL << 32) + carry;
            o[j] = r % 10;
            carry = r / 10;
        }
        lud = j;
        carry = 0;
        for(j = 0; j <= lud || carry; j++)
        {
            digit r = o[j] * (1LL << 32) + carry;
            o[j] = r % 10;
            carry = r / 10;
        }
        lud = j;
        carry = *i;
        for(j = 0; carry; j++)
        {
            digit r = o[j] + (carry % 10);
            carry /= 10;
            carry += r / 10;
            o[j] = r % 10;
        }
        if(j > lud)
            lud = j;
    }
    for(int j = lud; j--;)
        s.put(o[j] + '0');
    return s;
}

inline uint64_t dmul(uint64_t x, uint64_t y, uint64_t &carry)
{
    asm("mulq %2" : "+a"(x), "=d"(carry) : "r"(y));
    return x;
}
inline digit dadd(digit x, digit y, digit &carry)
{
    asm("movq $0, %1; addq %2, %0; adcq %1, %1" : "+r"(x), "=r"(carry), "+r"(y));
    return x;
}

void multiply(number &x, digit y)
{
    x.resize(x.size() + 2);
    digit carry = 0;
    for(number::iterator i = x.begin(), end = x.end(); i != end; i++)
    {
        digit nc, res = dmul(*i, y, nc);
        *i = dadd(res, carry, carry);
        carry += nc;
    }
    size_t sz = x.size();
    for(number::const_reverse_iterator i = x.rbegin(), end = x.rend(); i != end; i++)
    {
        if(*i)
            break;
        sz--;
    }
    x.resize(sz);
}

int main()
{
    const int r = 390000;
    clock_t start = clock();
    number n;
    digit mult = 1;
    n.push_back(1);
    for(digit a = 2; a <= r; a++)
    {
        digit carry, m = dmul(mult, a, carry);
        if(carry)
        {
            multiply(n, mult);
            mult = a;
        }
        else
            mult = m;
    }
    multiply(n, mult);
    std::cout << "Took: " << (clock() - start)/((double)CLOCKS_PER_SEC) << std::endl;
    std::cout << n << std::endl;
}

Check your score. You need to run the question's Python 2.7 program on your computer. For my computer, I compiled your program with g++ -O2 factorial.cc -o factorial and it scores 3.90 = 382000 / 98000.

Weird, I got 3.9 and you got 3.0 for this program. I guess your faster computer is a penalty. Perhaps your program loses its advantage over Python as r increases. If so, and you can do a higher r in 10 seconds, then your score goes down.

C#: 0,48 (77,000 / 160,000)
I'm not happy with this.
Is C# that slow?
But here is my entry anyway.
static void Main(string[] args)
    {
        Console.WriteLine("Enter N for fatorial:");
        int n = Convert.ToInt32(Console.ReadLine());

        Stopwatch s = Stopwatch.StartNew();

        BigInteger result = 1;
        while (0 <-- n) result *= n;

        s.Stop();

        Console.WriteLine("Output: {0} ", result);

        Console.WriteLine("Completed in {0}", s.Elapsed);

    }

When n = 77000 it takes 00:00:09:8708952 to calculate.
I'm running in Release mode, outside Visual Studio, using a Core i3-2330M @2.2GHz.
Edit: Since i'm not doing anything intelligent, I accept that result. Maybe the .NET Framework 4.5 is addind some overhead (or BigInteger isn't that fast).

Please give the score and not just n

You could use zero approached by operator to make it prettier (like start with n = ... + 1 then do while (0 <-- n) result *= n;)

BigInteger for .NET probably did not implement algorithms for multiplying larger numbers, like Karatsuba or Toom-3. If so, this is a good example of how Python is faster.

Python 3, advanced algo by Peter Luschny: 8.25x (1 280 000/155 000)
Shamelessly copied from Peter Luschny,
http://www.luschny.de/math/factorial/FastFactorialFunctions.htm,
who provides this code under the "Creative Commons Attribution-ShareAlike 3.0" license.
This is actually a quite advanced algorithm, using something called the "swinging factorial" and a list of primes. I suspect it could be even faster if it did like many of the other answers and performed most of the multiplications with 32 bit integers.
#! /usr/bin/python3
import time
import bisect

def Primes(n) :
  primes = [2, 3]
  lim, tog = n // 3, False
  composite = [False for i in range(lim)]

  d1 = 8; d2 = 8; p1 = 3; p2 = 7; s = 7; s2 = 3; m = -1

  while s < lim :             # --  scan the sieve
      m += 1                  # --  if a prime is found
      if not composite[m] :   # --  cancel its multiples
          inc = p1 + p2
          for k in range(s,      lim, inc) : composite[k] = True
          for k in range(s + s2, lim, inc) : composite[k] = True

          tog = not tog
          if tog: s += d2; d1 += 16; p1 += 2; p2 += 2; s2 = p2
          else:   s += d1; d2 +=  8; p1 += 2; p2 += 6; s2 = p1

  k, p, tog = 0, 5, False
  while p <= n :
      if not composite[k] : primes.append(p)
      k += 1;
      tog = not tog
      p += 2 if tog else 4

  return primes

def isqrt(x):
  '''
  Writing your own square root function
  '''
  if x < 0: raise ValueError('square root not defined for negative numbers')
  n = int(x)
  if n == 0: return 0
  a, b = divmod(n.bit_length(), 2)
  x = 2**(a + b)
  while True:
      y = (x + n // x) // 2
      if y >= x: return x
      x = y

def product(s, n, m):
  if n > m: return 1
  if n == m: return s[n]
  k = (n + m) // 2
  return product(s, n, k) * product(s, k + 1, m)

def factorialPS(n):

  small_swing = [1,1,1,3,3,15,5,35,35,315,63,693,231,3003,429,6435,6435,
          109395,12155,230945,46189,969969,88179,2028117,676039,16900975,
          1300075,35102025,5014575,145422675,9694845,300540195,300540195]

  def swing(m, primes):
      if m < 33: return small_swing[m]

      s = bisect.bisect_left(primes, 1 + isqrt(m))
      d = bisect.bisect_left(primes, 1 + m // 3)
      e = bisect.bisect_left(primes, 1 + m // 2)
      g = bisect.bisect_left(primes, 1 + m)

      factors = primes[e:g]
      factors += filter(lambda x: (m // x) & 1 == 1, primes[s:d])
      for prime in primes[1:s]:
          p, q = 1, m
          while True:
              q //= prime
              if q == 0: break
              if q & 1 == 1:
                  p *= prime
          if p > 1: factors.append(p)

      return product(factors, 0, len(factors) - 1)

  def odd_factorial(n, primes):
      if n < 2: return 1
      return (odd_factorial(n // 2, primes)**2) * swing(n, primes)

  def eval(n):
      if n < 0:
          raise ValueError('factorial not defined for negative numbers')

      if n == 0: return 1
      if n < 20: return product(range(2, n + 1), 0, n-2)

      N, bits = n, n
      while N != 0:
          bits -= N & 1
          N >>= 1

      primes = Primes(n)
      return odd_factorial(n, primes) * 2**bits

  return eval(n)

start = time.time()
answer = factorialPS(1280000)
print(time.time()-start)

Java - 10.9
n = 885000
Mergesort-y.
import java.math.BigInteger;

public class Factorials {

    public static BigInteger fac;

    public static BigInteger two = BigInteger.valueOf(2);

    static BigInteger mul(BigInteger start, BigInteger end) {
        if(start.equals(end)) {
            return start;
        } else {
            BigInteger mid = start.add(end.subtract(start).divide(Factorials.two));
            return Factorials.mul(start, mid).multiply(Factorials.mul(mid.add(BigInteger.ONE), end));
        }
    }

    public static void main(String[] args) {
        Factorials.fac = BigInteger.valueOf(Integer.parseInt(args[0]));
        long t = System.nanoTime();
        BigInteger result = mul(BigInteger.ONE, fac);
        t = System.nanoTime() - t;
        System.out.print(String.valueOf(((float) t) / 1000000000)); //result.toString()+" @ "+
    }
}

BigIntegers are slow.
Recommendations for arbitrary-precision high-speed Java integer libraries? :P

Can I steal your code to make it multithreaded?

@SimonKuang Go ahead. :P Multi-threaded entries aren't allowed here, though. Also, you might want to use a more efficient BigInteger implementation.

Mergesort-y
It's called divide-and-conquer.

Python 3, n = 100000
A simple algorithm change was all that was needed to bump the sample code up by 10000.
import time

def factorial(n):
    result = 1
    while n > 0:
        result *= n
        n = n - 1
    return result

start = time.clock()
answer = factorial(100000)
end = time.clock()

print(answer)
print("Time:", end - start, "sec")

Obviously not the most creative answer, but there's really only one way to do a factorial....

Please give the score, see my edit. The bump would probably be because your machine is better than mine.

Python 3: 280000 / 168000
Time running your program: between 9.87585953253 and 10.3046453994. Time running my program: about 10.35296977897559.
import time

def factorial(n):
    f = 1
    while n > 1:
        hn = n >> 1
        f = f * 2**hn * double_factorial(n) #dfl[hn + (n & 1) - 1]
        n = hn
    return f
def double_factorial(n):
    #dfl = [1]
    p = 1
    l = 3
    mh = n
    while l <= n:
        p *= l
        l += 2
        #dfl.append(p)
    return p

start = time.clock()
factorial(280000)
end = time.clock()

print(end - start)

I read this answer on cs.SE and decided to try to implement it in Python. However, I accidentally discovered that n! = (⌊n / 2⌋)! * 2**(⌊n / 2⌋) * n!! (note: !! is the double factorial). So I converted that to a non-recursive form.
The comments show my attempt to avoid recomputing the double factorial, but I discovered that storing every value was too memory-costly that it caused my computer to run even slower. I can improve this by only storing what is needed.
Strangely, I implemented the naive straight multiplication in Python 3, and it does better than your program: n = 169000 in 10 seconds.:
def factorial(n):
    p=1
    for i in range(n):
        p*=i+1
    return p

Ruby 2.1
score = 1.80 = 176_000 / 98_000
EDIT: improved from 1.35 = 132_000 / 98_000
I took ideas from the GMP factorial algorithm. This program uses the standard library to generate prime numbers. Ruby is a bad choice because multiplication seems slower in Ruby than in Python.

My program in Ruby 2.1: score = 1.80 = 176_000 / 98_000
Trivial algorithm in Python 2.7: score = 1 = 98_000 / 98_000
Trivial algorithm in Ruby 2.1: score = 0.878 = 86_000 / 98_000

Yes, my binary of ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-openbsd] links against GMP. Ruby 2.1 added a feature to use GMP for large multiplication, but it still seems slower than Python 2.7.
require 'benchmark'
require 'optparse'
require 'prime'

def factorial(n)
  # calculate primes up to n, drop the 2
  @odd_primes = Prime.each(n).drop(1)

  # count prime factors of factorial(n)
  @factors = Hash.new(0)
  factorial_recurse(n)

  shift = @factors.delete(2) || 0
  @factors.inject(1) {|product, (base, exp)|
    product * base**exp
  } << shift
end

def factorial_recurse(n)
  return if n < 2

  # collect prime factors of 2 * 4 * 6 * .. * n
  #  = (2 * 2 * 2 * .. * 2) * (1 * 2 * 3 * .. * exp)
  #  = 2**exp * factorial(exp) where exp = floor(n/2)
  exp = n >> 1
  factorial_recurse(exp)
  @factors[2] += exp

  # collect prime factors 3 * 5 * 7 * ... * n
  for prime in @odd_primes
    break if prime > n
    exp = 0
    # count occurences of prime, prime**2, prime**3, .. n
    prime_power = prime
    until prime_power > n
      # floor(n / prime_power) occurences in 1 * 2 * .. * n,
      # but only ceil(count / 2) occurences in 3 * 5 * .. * n
      @factors[prime] += (n / prime_power + 1) >> 1
      prime_power *= prime
    end
  end
end

# usage: factorial.rb [-ct] [number]
cflag = tflag = false
OptionParser.new {|opts|
  opts.on('-c', 'Check for bugs') { cflag = true }
  opts.on('-t', 'Use trivial algorithm') { tflag = true }
  opts.parse!
}
$*[1] and fail 'too many arguments'
n = Integer($*[0] || 176_000)

if cflag
  factorial(n) == (1..n).reduce(1, :*) or
    fail "bad program: factorial(#{n}) is wrong"
  puts "ok"
  exit
end

# measure processor time to calculate factorial
f = nil
if tflag
  time = Benchmark.measure { f = (1..n).reduce(1, :*) }
else
  time = Benchmark.measure { f = factorial(n) }
end
puts f
puts "Time #{time.total} sec"

Julia - Score = 15.194
Utilising the exact same approach as that of the reference program... that is,
f(n)=reduce(*,1:big(n))

So it uses reduce, the basic binary multiplication operation, and a range (in this case, using big(n) to force the calculation to be done in BigInt rather than Int64). From this, I get
julia> @time K=f(2340000);
elapsed time: 9.991324093 seconds (814552840 bytes allocated)

On my computer, with reference program running with input of 154000, I get Time: 10.041181 sec output (run using python ./test.py, where test.py is the name of the file containing the reference code)

tcl, 13757
My answer is to check the limits of tcl.
The first line is only to set an input parameter:
set n 13757

The others are the algorithm itself:
set r 2
for {set i 3} {$i <= $n} {incr i} {set r [expr {$r*$i}]}
puts $r

I tested my code on http://rextester.com/live/WEL36956; If I make n bigger, I get a SIGKILL; may n can get bigger on  a local tcl interpreter, which I do not have.

You need to post the score as defined in the question - the ratio of your code's speed to the reference Python speed.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Draw the € sign
The goal is to output or display an image with an € (euro) sign according to the following specs (ignoring the border of the sign).

Source: http://en.wikipedia.org/wiki/File:Euro_Construction.svg
Rules:

The program / script must take the height of the € sign in pixels as an argument (empty space around the sign is optional)
The € sign can't be drawn as or from a character, directly (it's forbidden to print the € in the image) or indirectly (calculating 8364 then displaying it in a HTML page)
The output does not need to be saved to any file, it can be displayed then just shown as a screenshot
Standard “loopholes” are forbidden
Shortest code wins

Tricky ! It's time to review my geometry/trigonometry. I see some coordinates quite difficult to deduce.

I had to look up "facultative"

Oops, I used a French word by mistake. Thanks for pointing it.

I'm really hoping for a LaTeX + TikZ answer :)

Without the Euro, this problem wouldn't exist, thereby once again demonstrating the truth of "Mo money mo problems"

Guys there is a huge issue with this question.... The question should specify whether or not the result is typographically usable - or whether the result is just a raster (or other) approximation The two things are of course entirely different. Note that the mathematica answer (while incredibly awesomely clever), is totally unusable. (The result image printed on the screen is, well ... totally wrong! - ask any typographer. There's no point saying "oh maybe if you increase the pixel" .. etc.) At the other extreme the P.S code is (of course) 100% usable typographically.

I don't know what is typographically usable and I'm not a typographer. If you want a perfect € sign, just use the € character. But that's not the goal of this question. I didn't expect pixel perfect images. Feel free to add another question with different rules if you don't like this one.

PostScript/GhostScript, 100
(96 for the program, 4 for the command-line switch prefix)
Fully golfed and hand-tokenized:
$ hexdump -C euro.ps
00000000  68 20 88 78 92 36 92 38  92 8b 88 4b 88 3c 92 ad  |h .x.6.8...K.<..|
00000010  88 00 88 00 88 3c 88 2d  88 ce 92 05 88 00 88 00  |.....<.-........|
00000020  88 32 88 d8 88 28 92 06  92 16 88 b9 88 fb 92 6b  |.2...(.........k|
00000030  88 b5 88 f1 92 63 88 13  88 f1 92 63 88 17 88 fb  |.....c.....c....|
00000040  92 63 92 16 88 b9 88 0f  92 6b 88 b5 88 05 92 63  |.c.......k.....c|
00000050  88 1b 88 05 92 63 88 1f  88 0f 92 63 92 16 92 42  |.....c.....c...B|
00000060

You can get a copy here, for your own viewing.
After seeing @ThomasW's answer, and considering my program carefully, I realized that I could do it even better.
The tokenized version is equivalent to this:
h 120 div dup scale
75 60 translate

0 0 60 45 -50 arc
0 0 50 -40 40 arcn
closepath

-71 -5 moveto
-75 -15 lineto
19 -15 lineto
23 -5 lineto
closepath

-71 15 moveto
-75 5 lineto
27 5 lineto
31 15 lineto
closepath

fill

An explanation of the optimizations:
First off, I converted my first solution into a union of some simpler subpaths, rather than one path circumscribing the entire thing. I borrowed Thomas's method of inputting a parameter, which is much better than what I had had.
Then I multiplied all the coordinates by 10 and rounded everything off to give me just integer coordinates. I also rounded off the angles, and converted the two large ones to equivalent negative angles. This conveniently makes every single number fall between -128 and 127.
And then I tokenized everything. Each operator can be represented with a two-byte sequence each. And because each number can be represented by a single signed byte, each one also becomes only two bytes. The only part I couldn't do that with was the h at the start, but it too is only two bytes, just the h and a space after it.
Run it as:
gs -dh=200 euro.ps

gs -dh=80 euro.ps

gs -dh=20 euro.ps

New: Even shorter versions!
Using encoded user paths, I have managed to reduce the program size by a few bytes. Each of these programs is equivalent to the first one, producing identical output:
92 bytes:
hexdump -C euro.ps
00000000  68 20 88 78 92 36 92 38  92 8b 88 4b 88 3c 92 ad  |h .x.6.8...K.<..|
00000010  7b 7b 88 b5 88 c4 88 2d  88 3c 30 20 30 88 3c 88  |{{.....-.<0 0.<.|
00000020  2d 88 cf 30 20 30 88 32  88 d8 88 28 88 b9 88 fb  |-..0 0.2...(....|
00000030  88 b5 88 f1 88 13 88 f1  88 17 88 fb 88 b9 88 0f  |................|
00000040  88 b5 35 88 1b 35 88 1f  88 0f 7d 8e 0b 00 07 08  |..5..5....}.....|
00000050  0a 01 23 03 0a 01 23 03  0a 7d 92 b3              |..#...#..}..|
0000005c

Which is equivalent to:
h 120 div dup scale
75 60 translate
{
 {-75 -60 45 60
  0 0 60 45 -50
  0 0 50 -40 40
  -71 -5
  -75 -15
  19 -15
  23 -5
  -71 15
  -75 5
  27 5
  31 15}
  <00 07 08 0A 01 03 03 03 0A 01 03 03 03 0A>
} ufill

And a slightly counterintuitive confusing solution saves one more character, for only 91:
$ hexdump -C euro.ps
00000000  68 20 88 78 92 36 92 38  92 8b 88 4b 88 3c 92 ad  |h .x.6.8...K.<..|
00000010  5b 5b 8e 1e b5 c4 2d 3c  00 00 3c 2d ce 00 00 32  |[[....-<..<-...2|
00000020  d8 28 b9 fb b5 f1 13 f1  17 fb b9 0f b5 05 1b 05  |.(..............|
00000030  1f 0f 7b 92 38 88 7f 92  50 7b 32 35 36 92 a9 7d  |..{.8...P{256..}|
00000040  92 54 7d 92 49 5d 92 32  8e 0b 00 07 08 0a 01 23  |.T}.I].2.......#|
00000050  03 0a 01 23 03 0a 5d 92  32 92 b3                 |...#..].2..|
0000005b

Which is equivalent to:
h 120 div dup scale
75 60 translate
[
  [
   <b5 c4 2d 3c
    00 00 3c 2d ce
    00 00 32 d8 28
    b9 fb
    b5 f1
    13 f1
    17 fb
    b9 0f
    b5 05
    1b 05
    1f 0f> {dup 127 gt {256 sub} if} forall
  ] cvx
  <00 07 08 0A 01 23 03 0A 01 23 03 0A>
] cvx
ufill

Great work! I guess I'll have to learn all about binary tokens.

@ThomasW. Although I'm not completely done yet; I am still reading through the encoded path strings documentation...

You don't need the space after h because binary tokens are self-delimiting. BTW, how did you code it? I did it with a standard hex editor, which is tedious.

@ThomasW. Really? For some reason it was causing trouble for me.

0 0 in ASCII is only three bytes while it's four in binary. Likwewise the single digit 5s are shorter than the two byte binary ones.

@ThomasW. Oh well. I will be posting a much shorter version soon anyway.

@ThomasW. Well, I wasn't ablw to shorten it that much, but it is shorter now. Too bad there aren't integral homogenous number arrays, or I could save another 26 bytes.

I didn't know about tokenizing files. Can you edit the .ps tokenized file? Is it really a program source file if you can't edit it? In other words, if you send me this tokenized .ps file, assuming I know Postscript, will I be able to alter the shape of the sign without the un-tokenized file?

@n.1 tokenized files work exactly the same as regular PostScript files, and you can even mix binary tokens and standard plaintext PostScript in the same file. Each binary token corresponds directly to an operator or other object, so you can easily replace or insert operations, or even copy snippets to another program. The exact details about the tokenized form can be found in the PostScript Language Reference Manual (the red book) in section 3.12. Encoded user paths are described in 4.6.2.

Do you need a special text-editor to edit the tokenized script? I opened the downloaded .ps with Geany (a text-editor) but I only see asian characters: 栠衸鈶鈸銋衋蠼銭蠀蠀蠼蠭裎鈅蠀蠀蠲裘蠨鈆鈖袹裻鉫袵裱鉣蠓裱鉣蠗裻鉣鈖袹蠏鉫袵蠅鉣蠛蠅鉣蠟蠏鉣鈖鉂

@n.1 I used a hex editor to write the file, for that reason. The token delimiter bytes normally correspond to control characters in ISO-latin-1 and other fixed-width encoding, but if the editor is interpreting it in UTF-8 or another variable-width encoding, you will get stuff like that, same with any other file that includes binary data.

@AJMansfield: I was able to open the .ps file with wxHexEditor, thanks.

Mathematica, 193 183 177 173 169 166 bytes
Yay, maths! I'm plotting the region that satisfies a certain (rather complicated) set of inequalities:
e=RegionPlot[(1<Abs@y<3||c)&&{x,y+12}.(d=2{-5Sin@40°-6,m=5Cos@40°})*{x+15,y+1-2Sign@y}.d<0||c&&x<2m/.c->100<x^2+y^2<144,{x,-15,9},{y,-12,12},Frame->0>1,ImageSize->#]&

Usage is e[height], e.g. e[100]:

Or e[200]:

You may notice, that the sharper edges are slightly rounded off. That's because the region can only be plotted by sampling the points in space, and Mathematica doesn't sample each pixel by default. The sampling resolution can be increased by adding another option  PlotPoints-># (which uses one sample per pixel), which adds 14 characters. I don't recommend running it with that option, because it significantly increases runtime and barely increases visual appeal beyond #/4 or so. Hence, (after approval of the OP) it is not included in the score.
Here is a slightly ungolfed version:
e[height_] := (
  angle = 40°;
  d = {-5 Sin[angle] - 6, 5 Cos[angle]};
  RegionPlot[
      (Abs[y] > .5 && Abs[y] < 1.5
        ||
       r > 25 && r < 36)
    &&
      {x, y + 6}.d > 0
    &&
      {x + 7.5, y + .5 - Sign[y]}.d < 0
    ||
      r > 25 && r < 36 && x < 5 Cos[angle]
    /. r -> x^2 + y^2
    ,
    {x, -7.5, 4.5},
    {y, -6, 6},
    Frame -> False,
    ImageSize -> height
  ]
);

Note that in the golfed version, I've scaled the coordinate system by a factor of 2 to avoid the .5s, but it turns out that the character count is actually identical.
Here is an explanation for how I worked out the formula. I divided the shape into two regions. One contains the ring and the stripes and is cut off to the right with the BCDE slope and to the left with the IJ and GH slopes (more on that later). The other contains the same ring, but is simply cut off at the x coordinate of point D. The conditions for the two regions are combined with ||, which acts as a set union here.
The ring is just defined as 5 < r < 6, where r is the distance from the origin. r² is easier to work out though (x²+y²), so I'm using 25 < x² + y² < 36 to get all the points in the ring.
The stripes are between ±.5 and ±1.5. We can handle both stripes at the same time, by taking the modulus of y, so the stripes (of infinite length) just fulfil .5 < |y| < 1.5. Again, to take the union of the stripes and the ring, I'm just using ||.
The interesting thing is probably how to get the "masks" though. Point D has an x coordinate of 5 cos 40°, so the mask taking care of lower edge (combined with the ring only) is just x < 5 cos 40°. This can be applied via set intersection which translates to && in logic.
The other masks are the really tricky part. First, let's get the slope of BCDE. We can easily construct points C and D, as (0, -6) and 5 (cos 40°, sin 40°), respectively. The vector pointing along the line is then just D - C = (5 cos 40°, 5 sin 40° + 6). To apply the mask on the right, I only need to figure out if a point lies to the left or the right of that line (let's call line vector p). I can figure this out by taking the vector from C to my point of interest and projecting it onto a vector perpendicular to p. The sign of the projection will tell me the side the point is on. Obtaining the perpendicular vector is pretty simple in 2D: flip the coordinates and reverse the sign of one of them. That's the variable d in my code: (-5 sin 40° - 6, 5 cos 40°). The vector from C to a point of interest q = (x, y) is q - C = (x, y + 6). The projection is just the scalar product (or dot product) between q and d. The way I chose d it happens to point to the left, so I want d.(q-C) > 0. This condition applies the right-hand mask.
For the left-hand mask I can use basically the same idea. The slope is the same and therefore so is d. I just need offset my point from the lower-left corners of stripes instead of from C. Those have coordinates (-7.5, 0.5) (upper stripe) and (-7.5, -1.5) (lower stripe). So that would call for two independent rules for the two stripes. However, note that all points affected by the lower mask are in the lower stripe and hence have negative y. And all points affected by the upper mask have positive y. So I can simply switch my offset using Sign[y] which is 1 for positive and -1 for negative y. So my offset point becomes (-7.5, -0.5 + Sign[y]). Otherwise the mask works just like the right-hand mask. Of course, this time the projection needs to be negative. So, naively that would be something like RH-projection > 0 && LH-projection < 0 (which is also what I originally had in the code). But we can shorten this, because multiplying a positive and a negative number has to give a negative number, so it's just RH * LH < 0 (where RH and LH are the respective projections).
That's it. Putting it all together leads to the following logical structure:
(
  (is_in_circle || is_in_stripe)
  &&
  is_between_left_and_right_mask
)
||
(
  is_in_circle && left_of_edge
)

Just to be clear, the coordinates in my explanation refer to the construction diagram given in the challenge. As mentioned above my code actually multiplies all of them by 2 - I changed it to save bytes, but the byte count is actually identical, and I couldn't be bothered to revert the change again. Also integers look nicer.

I'm relatively new to Mathematica, so I'd appreciate some comments on your code!

@ThomasW. well, the actual Mathematica stuff is just a call to RegionPlot which simply colours in all points in space that satisfy a given condition. So giving it x^2+y^2<1 will draw a unit circle. I'll add an explanation for the actual maths though (later tonight).

What is the length of the code with not rounded edges? I think you have the shortest code at this moment, but I can't accept your answer with the rounded corners, it would be unfair to the other answers which have not rounded corners. Please follow strictly the specifications. Thanks

@n.1 Unless you're disqualifying Thomas W.'s PostScript answer, because it's binary or because it's rounded too aggressively, his answer is definitely shorter. However, fixing the resolution takes 14 characters, so my answer is still the shortest after his. I'll edit.

@ThomasW. there you go!

@m.buettner : since you have most votes, the other users didn't see any problem with the rounded edges. So I will forget it and accept that this is an € sign. :-)

@n.1 So should I reduce my score by 14 again?

@m.buettner : I looked at your edits but didn't see that you added 14 to the score. Yes, you can subtract 14 from your score.

BBC BASIC, 202
INPUTh:w=h/12s=w/2.4p=25VDU22,6,29,640;400;p,4,0;1.5*w;p,153,6*w;0;p,4,0;1.5*w;p,159,h/3.1;4.7*w;p;9*s;9*w;p,87,h/3.1;-19*w;p,4,-7.5*w;0;p;s;w;p,85,4.5*s;0;p,81,s;w;p;s;w;p;s;w;p,85,-7.5*w;2*w;p,81,s;w;

download emulator at http://www.bbcbasic.co.uk/bbcwin/bbcwin.html
In BBC basic, all graphics are handled at the low level using machine-specific ASCII control characters (but some high level commands are also available for the common ones for convenience.) The ones used here are 22 (change display mode) 29(change origin) and 25, equivalent to the PLOT statement, which takes an additional action parameter (draw line, circle, triangle, etc. in background/foreground with relative/absolute move) before the X and Y parameters.
So all I have to do is send a load of characters to the VDU controller. values terminated in semicolon are 16 bit. others are 8 bit. The total number of bytes sent to the VDU controller is 91, though that in itself would not qualify as an answer because by that stage the size is hardcoded.
The obvious place for the origin is the centre of the circle, but there are actually more commands involved in producing the bars. So I shifted the origin down 1.5 to the bottom of the lower bar, which reduces the number of fractions and negative numbers required. It remains on the vertical line with the centre of the circle, which is important because the line E starts from this vertical line.
Actually, I only had to calculate 3 numbers off the drawing: the top inner corner of the C shape (5 cos 40, 5 sin 40 + 1.5) = (3.8302,3.1394+1.5) = approx (12/3.1, 4.6) and the gradient of the line E:x/y=3.8302/(6+3.1394)=0.4157 = approx 1/2.4
As I only have the free evaluation version (interpreted), I take the symbol height as user input. If you buy the full version (29.99GBP) you can compile and then read the command line with w=VAL(@cmd$)/12.
Ungolfed code
In the golfed code, there is only one VDU statement, but in the ungolfed code I break it down into several for clarity. Also, because BBC basic is little endian, the combination p,0, can be golfed to p; but I left it ungolfed for clarity.
  INPUT h
  w=h/12                   :REM w is the width of the line, which is 1/12 the height of the symbol, hardcoded at 900.
  s=w/2.4                  :REM s/w is the gradient x/y of line E. s is the horizontal offset of the top and bottom of the ends of horizontal bars
  p=25                     :REM VDU p,action,x;y; is the equivalent of PLOT action,x,y

  VDU 22,6                 :REM change mode
  VDU 29,640;400;          :REM set origin

  VDU p,4,0;1.5*w;         :REM move to centre of circle
  VDU p,153,6*w;0;         :REM draw circle in foreground colour
  VDU p,4,0;1.5*w;         :REM move to centre of circle
  VDU p,159,h/3.1;4.6*w;   :REM draw circle in background colour, ending at the upper inner point of the C shape.
  VDU p,0,9*s;9*w;         :REM move relative along slant gradient, 9 spaces in y direction, to define the upper cut on the circle
  VDU p,87,h/3.1;-19*w;    :REM draw triangle in background colour, based on the last two points and the absolute point specified here (vertical line for lower cut)

  VDU p,4,-7.5*w;0;        :REM move absolute to bottom left of lower bar
  VDU p,0,s;w;             :REM move relative to top left of lower bar
  VDU p,85,4.5*s;0;        :REM draw triangle to bottom right corner of lower bar (absolute)
  VDU p,81,s;w;            :REM draw triangle to top right of lower bar (relative)

  VDU p,0,s;w;             :REM move relative to bottom right of upper bar
  VDU p,0,s;w;             :REM move relative to top right of upper bar
  VDU p,85,-7.5*w;2*w;     :REM draw triangle to bottom left of upper bar (absolute)
  VDU p,81,s;w;            :REM draw triangle to top left of upper bar (relative)

BBC BASIC. Awesome! This takes me back almost thirty years!

@Dommer BBC Basic was first released in 1981, more than 20 years before the first Euro notes were printed (2002.) So this is the only way you could have drawn a large euro sign on such a machine! Alternatively you could redefine ASCII character n to a euro symbol with an 8x8 bitmap, like this: VDU 23,n,30,33,120,32,120,30,30,0. According to Wikipedia, BBC Basic is still being developed, mainly for mobile devices.

Indeed! I think we got ours in 1984. I remember drawing cool sprites on graph paper and then working out their binary representations, as I'm sure you have done too. On which note, I just drew out your Euro symbol by hand. It's very good once the typo is fixed and the antepenultimate value is changed from 30 to 33. I see from your profile you have also used LOGO which again takes me back to my primary school days. It's great to learn BBC Basic is still in use today. If it was good enough for us...

Just to add, the BBC Basic 8x8 bitmap could be made more "italic" (in keeping with the larger logo) by changing it to VDU 23,n,30,33,124,32,120,33,30,0. Thanks for the trip down memory lane.

HTML, 250 249 248 242 244 234 229
<svg viewBox=-7.5,-6,12,12
onload=this.style.height=prompt()><clipPath
id=c><path
d=M5-6,1.8,1.5,3.8,3.2V6H-9.4L-7.1,.5-7.5-.5-5.2-6>
</clipPath><g
clip-path=url(#c) fill=none stroke=#000><circle
r=5.5 /><path
d=M-8,1h15M-8-1h15>

While this is only using SVG stuff, it heavily relies on lax HTML parsing and has to be served as HTML.  Strict SVG would require a lot more bytes.
Try it!

(-: ǝɯ oʇ ǝuıɟ sʞoo⅂

Yeah, I was thinking in PostScript coordinates, which are the other way round!  Swapped the y axis now.

Work for me (Chrome 34) even without the trailing </svg>. Oh, and that markup is horrible. I hope you're ashamed of yourself. ;-)

@IlmariKaronen I am ashamed ;-). Usually I even prefer clean XHTML over HTML. Anyway, if I leave away the trailing </svg>, I only see the circle not the lines (in a standalone file, not inside the markup JS Bin might add).

You can shorten evt.target to this, saving 6 bytes.

@toothbrush Thanks! Included that.

-8 bytes using onload='this.style.height=prompt()' works in FF and Chrome

@nderscore Thanks for your help! It's even 10 bytes without the quotes.

Without the quotes, Firefox doesn't prompt :(

@nderscore Interesting!  For me it does (FF 29/Linux).

Seems it was because I was testing it without the linebreaks.

To save a byte you can change #000 to red.

It's 2 years later, but I was grabbing this demo as an extreme example of the difference between the HTML & XML parsers & discovered that the trailing </svg> is just confusing matters.  All you need is a closing > for the path. The </svg part is getting parsed as part of the path data attribute.

@AmeliaBR Ah, thanks for spotting this. No idea why I didn't close the path tag. This explains why in one comment I stated I didn't see the horizontal lines without the closing </svg>.

Yep, without at least one >, the parser just throws out the final, incomplete tag.

Oh, there is a recording of @AmeliaBR's talk featuring this nasty piece of code. Hope your work on SVG 2 soon gets to the state of a final recommendation after all those years!

CSS, 512 494 bytes
<style>*,:after,:before{position:absolute;width:20;content:"";background:#fff}#a{margin:150;height:20;border:2px solid;border-radius:20px}#a:after{width:10;height:10;bottom:0;right:-8}p{top:7;left:-6;width:29;height:2;border:solid;border-width:2 0;transform:skewX(-23deg);margin:0;background:0}p:before{width:2;height:4;bottom:-3;left:-.5}p:after{width:16;height:16;bottom:-3;right:-8}</style><div id=a><p><script>document.getElementById('a').style.transform='scale('+(prompt()/24)+')'</script>

Not the smallest answer by a fair bit, but as small as I could get even when summoning all my css-minification-fu
Caveats:
The above code with all 'px' stripped works in Firefox & IE but not Chrome & Safari which are fussier about their units :)
I also had to re-add the px's to get the jsfiddle to work:
http://jsfiddle.net/9A3J9/
100:

200:

ungolfed code:
 <style>
*,:after,:before{
    position:absolute;
    width:20;
    content:"";
    background:#fff
}
#a{
    margin:150;
    height:20;
    border:2px solid;
    border-radius:20px
}
#a:after{
    width:10;
    height:10;
    bottom:0;
    right:-8
}
p{
    top:7;
    left:-6;
    width:29;
    height:2;
    border:solid;
    border-width:2 0;
    transform:skewX(-23deg);
    margin:0;
    background:0
}
p:before{
    width:2;
    height:4;
    bottom:-3;
    left:-.5
}
p:after{
    width:16;
    height:16;
    bottom:-3;
    right:-8
}
</style>

<div id=a><p>

<script>
document.getElementById('a').style.transform='scale('+(prompt()/24)+')'
</script>

Wow! That skewX trick could get my upvote alone.

that's exactly what I started writing yesterday. false points to you then

setting an id on the div and using getElementById reduces 6 char. and then you can use the id in the css to reduce 2 more

also, the p closing tag can be omitted if there is no more content after it (by spec). and i'd check also if the browsers autoclose the div (altough forbidden by spec, it worked in the fiddle on FF)

@einacio great suggestions! we're down to 494 B. thanks :)

PostScript+Ghostscript 137 + 6 = 143 (binary), 209 + 6 = 215 bytes
Fully golfed version with binary tokens:
$ hexdump -C euro_golfed.ps
00000000  68 20 31 32 20 92 36 92  38 92 8b 37 2e 35 20 36  |h 12 .6.8..7.5 6|
00000010  92 ad 35 20 36 0a 31 2e  38 20 2d 31 2e 35 0a 33  |..5 6.1.8 -1.5.3|
00000020  2e 38 20 2d 33 2e 32 0a  33 2e 38 20 2d 36 0a 2d  |.8 -3.2.3.8 -6.-|
00000030  39 2e 34 20 2d 36 0a 2d  37 2e 31 20 2d 2e 35 0a  |9.4 -6.-7.1 -.5.|
00000040  2d 37 2e 35 20 2e 35 0a  2d 35 2e 32 20 36 92 6b  |-7.5 .5.-5.2 6.k|
00000050  37 7b 92 63 7d 92 83 35  2e 35 92 14 30 92 6f 2d  |7{.c}..5.5..0.o-|
00000060  38 20 2d 31 0a 2d 38 20  31 92 6b 32 7b 31 35 20  |8 -1.-8 1.k2{15 |
00000070  30 92 85 92 6b 7d 92 83  30 20 30 20 35 2e 35 20  |0...k}..0 0 5.5 |
00000080  30 20 33 36 30 92 05 92  a7                       |0 360....|
00000089

Download hand coded binary file
ASCII version:
h 12 div dup scale
7.5 6 translate
5 6
1.8 -1.5
3.8 -3.2
3.8 -6
-9.4 -6
-7.1 -.5
-7.5 .5
-5.2 6
moveto
7{lineto}repeat
clip newpath
5.5 0
-8 -1
-8 1
moveto
2{15 0 rlineto moveto}repeat
0 0 5.5 0 360 arc
stroke

Save as euro.ps and run with Ghostscript like
gs -dh=80 euro.ps

gs -dh=20 euro.ps

As there is no such thing as a pixel in PostScript, that height is interpreted in points instead. I calculated +6 for the switch on the command line.

Meh, how am I supposed to beat the compiled file size. :D ... How do those binary tokens work? Isn't it basically like compiling the code by hand?

DC line doesn't cut horizontal stripes correctly. Perpendicular down from D doesn't cut 'circle' shape at the right place, lower :(. Looks like same is with your SVG answer, too.

Left edges of horizontal stripes are not aligned.

@m.buettner The most important PostScript names can be expressed using a two byte sequence. This is not really compiling like you would compile a C or Java program. It will go through the same parsing process as any PostScript program. If you look at the hexdump or open the binary file in a text editor you can see that it's almost the same as the ASCII version, but most names were replaced by a two byte sequence.

@VadimR You have a sharp eye! I guess I traded too much of the precision for brevity (rounding too aggressively).  I might have to add some digits.

@VadimR Thanks for the hints, I actually miscalculated one point and dropped a tenth digit.

If A is 0,0, then where mask intersects lower stripe, y = -1.5 therefore x = 1.5/tan40 i.e. 1.7876... not 1.8. If E has y = 6, then x = 12*5*cos40/(6+5sin40) i.e. 4.9883... not 5. It's visible if scaled up to 1000 px or more - DC line still doesn't cut stripes where expected. I mean, if no irrational numbers are hard-coded (moreover rounded), then picture is scalable to whatever size with no distortions. Sorry, it's only my nagging, - please ignore.

I wrote another even smaller postscript solution here.

PHP, 432 435 367 356 334 bytes
(Edit: Apparently IJ and GH are supposed to be parallel with BCDE. Now fixed)
This script outputs an SVG image, but will serve it as text/html by default. I think most browsers will treat this as an HTML web page containing an embedded SVG image. It seems to work OK for me anyway.
The height of the image is passed as a query string parameter. (Note: the byte count includes a newline character at the end of line 3, which is necessary for this to work properly).
<?php $x=$_GET['x']/12;$a=$x*5;$b=$x*6;$c=$x*7;$d=$x*12.4884;$e=$x*2.2863;$f=$x*5.5;$g=$x*.4157;$h=$x*6.5;$i=$x*7.5;$j=$x*12;$k=$x*11.3302;$l=$x*9.1628;$m=$x*8;$s=$x*12;echo<<<Q
<svg width="$s" height="$s"><clipPath id="c"><path d="M$d 0H$e L0 $f L$g $h L0 $i V$s H$k V$m H$l z"/></clipPath><g clip-path="url(#c)" fill="none" stroke="#000" stroke-width="$x"><circle cx="$i" cy="$b" r="$f"/><path d="M0 $a H$k M0 $c H$k"/></g></svg>
Q;

Updated version (367 356 334 bytes):
preg_replace_callback() is a much more efficient way of scaling the numerical values. This code produces the same output as the original version. (Edit: Further reductions thanks to Einacio)
<?php
echo preg_replace_callback('/[\d\.]+/',function($m){return$m[0]*$_GET['x']/12;},'<svg width=12 height=12><clipPath id=c><path d=M12.4884,0H2.2863L0,5.5,0.4157,6.5,0,7.5V12H11.3302V8H9.1628z /></clipPath><g clip-path=url(#c) fill=none stroke=black stroke-width=1><circle cx=7.5 cy=6 r=5.5 /><path d=M0,5H11M0,7H11 /></g></svg>');

Output:
euro.php?x=60

euro.php?x=200

width and height are unnecessary here. And you need to specify the xmlns for it to render in most browsers (tested Firefox and Chrome; even with SVG's proper MIME type sent, they both render it as XML, not SVG). http://ideone.com/JkqVL0 (remove the hardcoded x value for a 369 byte solution)

@TimS. No, it won't work properly if you run the PHP code at ideone and copy the results to an SVG file. But if you actually publish the script on a web server, PHP will (by default) serve the results with a MIME type of text/html. Chrome and Firefox have no problems with this, although I just discovered that Safari is a bit more pernickety.

Ah! I see the trick now: text/html with <svg>... is interpreted as an HTML file with an svg element, which doesn't need the xmlns but does need width and height. I was thinking in terms of an SVG file, which needs the proper xmlns. Your code is fine.

on the second code, if you use 24 instead of 12, wouldn't you reduce 1 byte on each x.5 value?

@Einacio Yes! :-) Unfortunately I also gain a byte at each occurrence of "5", "6", "7" and "8". The resulting length is exactly the same.

bummer.
since the svg is interpreted as an html, you do not need the attributes to be xml well-formed. thus, you can remove the quotes on attributes with simple values (width, height, cx, cy, r, fill, stroke, id, stroke-width). but r should be r=5.5 /> with an space so the slash is not counted as attribute value

@Einacio That seems to work. Thanks :-)

Python - turtle - 517
import turtle,sys
from math import *
q=sqrt
h=int(sys.argv[1])/24
t=turtle.Turtle()
z=t.begin_fill
y=t.end_fill
x=t.goto
w=t.towards
v=t.fd
u=t.circle
r=t.seth
o=t.setx
n=t.xcor
t.pu()
x(10*h,0)
t.left(90)
t.circle(10*h,40)
z()
A=w(0,-12*h)
B=2/sin(A*pi/180)
u(10*h,280)
r(-90)
C=n()/h
v((q(144-C*C)-q(100-C*C))*h)
D=w(0,0)
r(D+90)
u(-12*h,D+135.42)
y()
F=2*pi/9
G=h*cos(F)/(5*sin(F)+6)
x(45*G,-3*h)
z()
o(-15*h)
r(A)
v(B*h)
o(45*G+15*h+n())
y()
x(65*G,h)
z()
o(-15*h)
r(A)
v(B*h)
o(65*G+15*h+n())
y()
t.ht()
input()

python % 100 and python % 500 respectively:

You could save a lot of characters by getting rid of a few of the shortcuts you define. You only use c once, so it would actually be shorter to just invoke it as math.cos, and I think there are probably others that you could unabbreviate to cut overall length.

You can shave off six characters by using from math import * then dropping the math. prefixes.

You define u=t.circle, but a few lines later you forgot to swap out a t.circle(...) call.

Turtle to draw the €. What a time to be alive.

sh, 8604
I think someone can probably do better, but let’s start this off.
echo [encoded data, 8524 characters]|base64 -d|unxz>e.svg;echo \<img src=e.svg height=$1\>>e.htm;firefox e.htm

Wouldn't that come under the standard loophole of hard-coding the output?

@AlexThornton It does take an input though.

This definitely falls under the "standard loopholes" category.

@Igglyboo: How so?

This is a very long answer for a code-golf challenge. :-)

@Igglyboo Disagree.  .svg is vector-based so can be infinitely scaled - and is by the $1 input parameter.

@minitech I borrowed/stole your technique, but golfed it down with a much smaller .svg http://codegolf.stackexchange.com/a/26733/11259

HTML5, 395
==> Try it online
<canvas id=c><script>_='function e,t,n){c.savtranslate,trotatn?0:.42)}v=docuEleById("c"c=vContex"2d"scalw=(v.width=v.height=promp))/12,w76,1arc(56--114.2,6,66-13,6.-   2,1 11.5)c.clearRec2restor-7mov-71lin6,.5,strokt(   .5--e(0,);1,ment.geteTo(';for(Y in $='  ')with(_.split($[Y]))_=join(pop());eval(_)</script>

The code is compressed using JSCrush.
Here is the uncompressed code :
<canvas id=c>
<script>
v=document.getElementById('c');
c=v.getContext('2d');
function r(){c.rotate(0.42)}
function t(x,y){c.save();c.translate(x,y)}
c.scale(w=(v.width=v.height=prompt())/12,w);
t(7.5,6);
c.arc(0,0,5.5,0,6);
c.stroke();
c.moveTo(-7.5,-1);c.lineTo(6,-1);
c.moveTo(-7.5,1);c.lineTo(6,1);
c.stroke();
c.clearRect(4.2,0,6,6);
t(0,6);r();
c.clearRect(0,-11,3,6.2);
c.restore();
t(-7.5,-0.5);r();
c.clearRect(-1,-2,1,2);
c.restore();
t(-7.5,1.5);r();
c.clearRect(-1,-1.5,1,1.5)
</script>

This can be reduced to 378 by golfing the source before applying crush: http://jsfiddle.net/_nderscore/EUBG8/

This is JavaScript, not HTML. I am tired of people not understanding how that works.

Yeah, because <canvas> tag is JavaScript... HTML5 is often used to not write HTML/CSS/JS. Not that people don't understand it, programmers are just often lazy (at least I am). Your comment seems a bit harsh.

@Mig I thought HTML+CSS+JS was called DHTML?

PostScript, 270

7 7 translate
/l{lineto}def
/o{0 0}def
o 6 44.85 165.52 arc
-7.08 1.5 l
-7.5 .5 l
o 6 175.22 184.74 arc
-7.08 -.5 l
-7.5 -1.5 l
o 6 194.48 309.67 arc
o 5 320 197.46 arcn
1.87 -1.5 l
2.29 -.5 l
o 5 185.74 174.26 arcn
2.7 .5 l
3.12 1.5 l
o 5 162.54 40 arcn
closepath fill

This just defines the outline by appending path elements based on coordinates I calculated with the help of GeoGebra, and then fills the outline.
I saved a few chars by adding shortcuts for lineto (/l{lineto}def) and the origin of the circle (/o{0 0}def).
To specify a different size, add a command of the form height width scale after the first blank line.
When run on its own, this draws the euro sign in the bottom left-hand corner of the page of the default page size. Just save it as anything.ps and view it with a document viewer.
Here is an image of it at the default size, rasterized to a little over 90 pixels per inch:

At 4x size:

You can also download the original for your own viewing pleasure.

Does it read any argument to define the size of the sign?

@n.1 oh, sorry, I didn't read that part of the spec. I'll fix it after dinner.

Please add a screenshot of the rendered file.

@n.1 I have added images.

PHP (without SVG), 628 597 bytes
Thanks to AsksAnyway for the nice shortcut for functions (e.g. $c = print; $c('Hello world!');).
<?php header('Content-type:image/png');$h=$_GET['h'];$i=imagecreatetruecolor($h*1.1,$h*1.1);$c=imagecolorallocate;$b=$c($i,0,0,0);$w=$c($i,255,255,255);imagefill($i,0,0,$w);$l=$h*.7;$t=$h*.55;$u=$h/12;$e=imagefilledellipse;$e($i,$l,$t,$h,$h,$b);$e($i,$l,$t,$h*5/6,$h*5/6,$w);$f=imagefilledpolygon;$f($i,array($l+$u*5,$t+$u*1.5,$l-$u*7.5,$t+$u*1.5,$l-$u*7.125,$t+$u*0.5,$l+$u*4,$t+$u*.5,$l+$u*4,$t-$u*.5,$l-$u*7.5,$t-$u*.5,$l-$u*7.125,$t-$u*1.5,$l+$u*5,$t-$u*1.5),8,$b);$f($i,array($l+$u*4.24,$t-$u*4.24,$l+$u*1.84,$t+$u*1.5,$l+$u*3.84,$t+$u*3.26,$l+$u*3.84,$t+$u*4.62,$h*2,$t,),5,$w);imagepng($i);

Call file.php?h=200 from your browser in order to see the image
The coordinates are based on measurements performed with GIMP
100 pixels:

200 pixels:

Layers added step by step:

Ungolfed code (with fractions, the golfed code has rounded values)
<?php
header('Content-type: image/png');

$h = $_GET['h'];

$i = imagecreatetruecolor($h * 1.1,$h * 1.1);

$c = imagecolorallocate;

# black
$b = $c($i,0,0,0);
# white
$w = $c($i,255,255,255);

imagefill($i,0,0,$w);

$l = $h * .7; # distance between left and center of the circle
$t = $h * .55; # distance between top and center of the circle

# one "unit", as defined by the specs
$u = $h / 12;

$e = imagefilledellipse;
# disk is black
$e($i, $l, $t, $h, $h, $b);
# inner disk is white
$e($i, $l, $t, $h * (5 / 6), $h * (5 / 6), $w);

$f = imagefilledpolygon;
# draw 2 bars in black
$f($i, array(
# bottom bar
$l + $u * 5, $t + ($u * 1.5), # bottom right
$l-$u * 7.5, $t + ($u * 1.5), # bottom left
$l-$u * 7.125, $t + ($u * 0.5), # top left
$l + $u * 4, $t + ($u * 0.5), # top right
# top bar
$l + $u * 4, $t - ($u * 0.5), # bottom right
$l-$u * 7.5, $t - ($u * 0.5), # bottom left
$l-$u * 7.125, $t - ($u * 1.5), # top left
$l + $u * 5, $t - ($u * 1.5) # top right
), 8, $b);

# hide right parts of bars and circle by drawing white
$f($i, array(
$l + $u * 6 * (212 / 300), $t - ($u * 6 * (212 / 300)), # right of the disk
$l + $u * 6 * (92 / 300), $t + ($u * 6 * (74 / 300)), # left = bottom right of bottom bar
$l + $u * 6 * (191 / 300), $t + ($u * 6 * (163 / 300)), # bottom of the circle
$l + $u * 6 * (191 / 300), $t + ($u * 6 * (231 / 300)), # bottom of the circle too
$h * 2, $t, # some point at the right of the image (outside the image)
), 5, $w);

imagepng($i);

Bash + ImageMagick + linux command-line tools, 460 bytes
base64 -d<<<H4sIADBMaVMAAy1Ru27DMAz8FUJdBVsk9QziLFo8uD/QrUDSOIDTBo1Rt39fUsl0POp0PEr7+88Zfq/L530w87redn2/bVu3cff1fe7JOdeLwsB2Oa7zYDw7A/Ppcp5XJWQO+9v7OsN9/VtOg/m4LMvuRS4ZOA7m1VkseQpBoQZvyXlQQPeA2JpEjVEGURL7EePkLCU3Rqw5Wo4EmLALVgaC9BUrk392OAWt0HUBPHrb+NQq4i5UzigeSU6Zsii5xOYiWLE0BCT1Z89QVKLD2dPEIbdEBasINWIDaiDxG2BjslpBXXTk5CeWFkYa1a2KuS0OMBfJ8RgdKzMr03DRP5Ojy5O8sE2ksdU1g+pcu+SqvILUWddNCBHbCIxvpj/s9ZsO/xXfC57OAQAA|zcat|convert -scale $1 svg:- png:-|xview stdin

This is the same technique as @minitech's answer.  But the .svg data comes from here, which is much shorter: http://commons.wikimedia.org/wiki/File:Euro_symbol_black.svg.  ImageMagick converts the vector data to .png data at the requested scale and pipes to xview.
Output for ./euro.sh 30:

Output for ./euro.sh 300:

Why is the large version not filled?

how can you output images to stdin?

@LưuVĩnhPhúc You cannot "output" to standard input. He's just sending a load of characters to base64, which is a program, which decompiles it into binary tokens (representing an svg file, apparently), with which he does more stuff.

@tomsmeding I believe they were confused by the window title being "stdin".

@ColeJohnson I think neither version filled, but on the small version the inner and outer lines are rendered close enough to appear solid.  Having said that there is clearly some weird aliasing thing going on with ImageMagick that I don't fully understand - but I think the generated image is close enough for code-golf ;-)

@LưuVĩnhPhúc png:- tells ImageMagick to output a .png-formatted stream to stdout, instead of to a file.  This is piped to xview.  The stdin option tells xview to read data streamed from stdin instead of from a file.

Can you explain why the biggest version is not filled? That's strange that the small one is but not the largest one.

The ./euro.sh 300 is too tall (the height of the image is 600 pixels)

POV-Ray (370 bytes)
I couldn't figure out how to render the same vertical area and preserve the aspect ratio at the same time, so I decided to go for the correct height and its up to the user to render only in 4:3 format
camera{angle 9 location 102*z right x*8 up y*6 look_at 0}
light_source{99*z color 1}
plane{z,0 pigment{color rgb 1}}
#declare b=difference{box{<-5,-.5,1>,<8,.5,1>}box{-2,2 rotate-67*z translate 9.4*x}}
difference{union{torus{5.5,.5 rotate 90*x}object{b translate y}object{b translate -y}}box{<-3.83,-5,-3>,<-7,0,3>}box{<0,7,3>,<-4,-2,-3>rotate 23*z translate-2.5*x}}

run with povray.exe /RENDER euro.pov -w600 -h800

Processing, 232 bytes
Processing doesn't really allow taking in command line arguments since it is so specialized for drawing, but my function takes in the parameter as height to compensate.  Coordinates are hard-coded/approximated from the image above, and the entire canvas is scaled based on the input parameter to get drawings of arbitrary sizes.
void E(int h){scale(h/12,h/12);noFill();strokeWeight(1);arc(7.5,6,11,11,0.7,PI*2-0.7,OPEN);noStroke();fill(0);shearX(-PI/6);rect(3.2,4.5,9,1);rect(4.4,6.5,8,1);shearX(PI/6);fill(255);rect(11,6,9,6);triangle(8.75,6,12.25,6,12.25,0);}

Ungolfed + entire program
void setup()
{
  size(575, 500);
}

void draw()
{
  background(255);
  E(height);
  noLoop();
}

void E(int h)
{
  scale(h/12,h/12);
  //Main "C"
  noFill();
  strokeWeight(1);
  arc(7.5,6,11,11,0.7,PI*2-0.7,OPEN);
  //settings for other shapes
  noStroke();
  //the two bars
  fill(0);
  shearX(-PI/6);
  rect(3.2,4.5,9,1);
  rect(4.4,6.5,8,1);
  //bottom cut of "C"
  shearX(PI/6);
  fill(255);
  rect(11,6,9,6);
  //top cut of "C"
  triangle(8.75,6,12.25,6,12.25,0);
}

Output

You can golf by using 1 instead of OPEN as well changing the 255 in the background and fill calls to -1

C (gcc) (MinGW), 277 276 bytes
-1 byte thanks to @ceilingcat
Added -lm compiler flags to TiO for illustrative purposes, but MinGW does not need it.
Outputs a 3-shade PGM file to STDOUT.
q,i,c;main(s,v)char**v;{float u=atoi(v[1])/12.,d,r;q=u*15;for(*v=memset(calloc(q,q+1),2,i=q*q);i--;i[*v]-=d<6&d>5|r>6&r<7|r>8&r<9&&r<7|c<q/2+u*3.83&&u*31.538-s>r*u|r>10&&u*7-s<r*u&&u*9-s<r*u|r<8)r=i/q/u,c=i%q,d=hypot(q/2-c,q/2-r*u)/u,s=2.405*c;printf("P5 %d %d 2 %s",q,q,*v);}

Try it online!

authors: Эрик Толмачев

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/