New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] DType info methods #51
Comments
hello, @lsh what we have to do here? |
@jayant-01 What I'm asking for amounts to just defining a few constants, kind of like the C numeric limits or the associated constants on Rust types. Ideally it would also work for |
ook @lsh i understand it, so basically we have a creat like a function which will return the lowest value in a list or any other dataset |
Am i right?? |
hello @lsh did i get it wrong please rectify ? |
@jayant-01 that's not exactly right. I'm asking for a function that will return the lowest possible value for a type, and the highest possible value for that type. These wouldn't change based on the dataset or input, except for something like |
I think the request here is pretty straight-forward and logical. @abduld can you route this appropriately? |
@lsh currently I don't have the access to Mojo playground so first let me have the permission then I can work on this. Is that will be okay? |
This makes perfect sense. One thing is that there are function like inf, nan, and neg_inf that are in the stdlib. Thanks for the suggestion to complete adding the numeric traits functions |
Fixed in latest release |
A few DType methods would be nice such as:
min_number[T: DType]() -> Int
max_number[T: DType]() -> Int
bits[T: DType]() -> Int
infinity[T: DType]() -> SIMD[T, 1]
for floating point typesnan[T: DType]() -> SIMD[T, 1]
for floating point typesThe text was updated successfully, but these errors were encountered: