gpt4 book ai didi

c# - Mathf.Sign(0) 不返回零

转载 作者:行者123 更新时间:2023-12-02 16:07:57 25 4
gpt4 key购买 nike

为什么 Mathf.Sign(0) 在 Unity 中返回 1?根据 C# 文档,它应该返回零。

Mathf.Sign(0.3); // 1
Mathf.Sign(-0.3); // -1
Mathf.Sign(0); // 1, expected 0

最佳答案

Unity Mathf.Signown behavior .要获得预期的行为,请改用标准 C# Math.Sign

关于c# - Mathf.Sign(0) 不返回零,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68882410/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com