Closed mtsokol closed 4 months ago
oh, strange. You're right, this should return Float64. I'll look into it.
Thank you! For Int16
and Int8
it should return Int16
according to promotion rules.
ah, I see. The issue is actually in the definition.
"""
fld_nothrow(x, y)
Returns `fld(x, y)` normally, returns zero and issues a warning if `y` is zero.
"""
fld_nothrow(x, y) = iszero(y) ? (@warn("Division by zero in fld"); zero(y)) : fld(x, y)
This definition returns Float32 or Float64 depending on whether y is zero
should be a quick fix.
I'll fix the floor-div functions, but also note:
The return type of Finch high-level interface is currently based on:
We may want to provide an interface inside Finch or otherwise which the user can directly modify to ensure predictable output types.
Hi @willow-ahrens,
One of the
array-api-tests
failures is caused by returning abstract dtypes instead of concrete ones infloor_div
for mixed data types. The lower one should be promoted to the larger size (rules):