Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
LHS 将如何在此代码中修复?
首先,LHS 发生在哪里?我猜它在第二次else if阅读s.r。
else if
s.r
从我一直在阅读的关于 LHS 的内容来看,我相信添加一个本地可以解决它:
float radius = s.r; if( d <= -radius ) ... else if( d >= radius) ...
但是由于 <= 是一个函数,它会阻止 <= 或任何其他将本地作为参考的函数修改它吗?
没有,请看下一张幻灯片。它会导致管道刷新。也很有可能会出现分支错误预测。