Don't restrict output dtype to input dtype.
Write a better docstring.