BASIC "sgn" function equivalent

H. S. Teoh hsteoh at qfbox.info
Thu Jul 28 15:03:34 UTC 2022


On Thu, Jul 28, 2022 at 02:30:38PM +0000, pascal111 via Digitalmars-d-learn wrote:
[...]
> Of-course D has a built in "sgn" function, but I like to do it with my
> hands to be sure of code, I'm some doubtful and don't trust alien
> works.

Just use the source, Luke!  Phobos is open source for a reason.

	https://github.com/dlang/phobos/blob/8280b1e7de6cca4dc9a593431591054a5b3aa288/std/math/traits.d#L694


T

-- 
Sometimes the best solution to morale problems is just to fire all of the unhappy people. -- despair.com


More information about the Digitalmars-d-learn mailing list