def serialise_real(f, context=None):
    """Serialise a Real value.

    f -- real number (int or float)

    If the absolute value is too small to conveniently express as a decimal,
    returns b"0" (this currently happens if abs(f) is less than 0.0001).

    """
    f = float(f)
    try:
        i = int(f)
    except OverflowError:
        raise ValueError
    if f == i:
        return str(i).encode('ascii')
    s = repr(f)
    if 'e-' in s:
        return b'0'
    return s.encode('ascii')
