A. M. Archibald wrote: > Hi, > > What are the rules for datatype conversion in ufuncs? Does ufunc(a,b) > always yield the smallest type big enough to represent both a and b? > What is the datatype of ufunc.reduce(a)? > This is an unintended consequence of making add.reduce() reduce over at least a ("long"). I've fixed the code so that only add.reduce and multiply.reduce alter the default reducing data-type to be long. All other cases use the data-type of the array as the default.
Regarding your other question on data-type conversion in ufuncs: 1) If you specify an output array, then the result will be cast to the output array data-type. 2) The actual computation takes place using a data-type that all (non-scalar) inputs can be cast to safely (with the exception that we assume that long long integers can be "safely" cast to "doubles" even though this is not technically true). -Travis ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion