https://amagamina.jp/no-if-range/
int v = (int)((x - 0.5) * 2);
float isInRange = (float)v / (v - ε);
εはイプシロン定数(CのFLT_MIN、Unityのfloat.Epsilonなど)で限りなく小さい値です。
日々巡り会ったものの感想・レビュー
https://amagamina.jp/no-if-range/
int v = (int)((x - 0.5) * 2);
float isInRange = (float)v / (v - ε);
εはイプシロン定数(CのFLT_MIN、Unityのfloat.Epsilonなど)で限りなく小さい値です。
© 2021 しろログ
Theme by Anders Noren — Up ↑