The function writes the numerator and the denominator, separated by the character ’/’, to the stream
that is passed as the argument. The stream can be a file stream, a string stream, or some other stream.
To support the chaining of write operations or the access to the stream’s state in the same statement,
the stream is returned by the function.