You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bool is the only integer subtype that never works with round, with a Float.
From #gripes on slack:
Lyndon White
I feel like round(Bool, 0.7) should return true. Not give an error
Alex Arslan
Why?
An error seems much more reasonable IMO
Lyndon White
Because Bool <: Number
we basically use bools as UInt1
Alex Arslan
Bool as a Number type is like the 2 of prime numbers
Lyndon White
accuracy = mean(predictions==ground_truth)
works great Bool(round(UInt8, 0.7)) works without error
as round(Bool, 1) works (edited)
Bool is like the only integer subtype we are apparently never allowed to round a float to.
Simon Byrne
I'd be on board with that
We generally take round(T, x) to be equivalent to convert(T, round(x)).
Jacob Quinn
yeah, seems reasonable to me.
Stefan Karpinski
As long as Bool is an integer type it should
The text was updated successfully, but these errors were encountered:
Bool is the only integer subtype that never works with
round
, with a Float.From #gripes on slack:
The text was updated successfully, but these errors were encountered: