On Thursday, 28 July 2022 at 12:02:54 UTC, pascal111 wrote:
I'm making an equivalent of "sgn" function of BASIC language, and I used "(T)" in its definition, but the function can receive wrong data by passing string data to it, how we can solve it?


Use isFloating!T and isIntegral!T traits.

The standard library **sng** function is a good example:

https://dlang.org/library/std/math/traits/sgn.html

Reply via email to