gpt4 book ai didi

Objective-C,C 多个等号在一个 if

转载 作者:太空宇宙 更新时间:2023-11-04 07:15:02 26 4
gpt4 key购买 nike

<分区>

我确实写了一个声明

if (sample.value > shortAverage > shortWithoutFirstAverage > longAverage) {

并期望 sample.value > longAverage

但这行不通,而且 sample.value < longAverage

可能会发生
(lldb) p (sample.value > shortAverage > shortWithoutFirstAverage > longAverage)
(bool) $13 = true
(lldb) p sample.value
(double) $14 = 0.029
(lldb) p longAverage
(double) $15 = 0.032
(lldb) p (sample.value > longAverage)
(bool) $16 = false
(lldb) p shortAverage

其他值

(double) $17 = 0.029821
(lldb) p shortWithoutFirstAverage
(double) $18 = 0.029802

看起来它被评估为

if ((sample.value > shortAverage) > (shortWithoutFirstAverage > longAverage)) {

但如何实现所需的 if 语句?,以便它是真的,即 (sample.value > shortAverage > shortWithoutFirstAverage > longAverage)

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