gpt4 book ai didi

Swift - 二元运算符 == 不能应用于两个 [[Double]] 操作数

转载 作者:搜寻专家 更新时间:2023-10-31 22:57:44 25 4
gpt4 key购买 nike

<分区>

我写了一个像这样的 little swift 函数:

func compareTest(values: [[Double]]) {
if(values == [[1.0,2.0]]) {
// some code
}
}

但是当我尝试编译时,我在比较时遇到错误:

Binary operator == cannot be applied to two [[Double]] operands.

我在这里的问题中进行了搜索。大多数答案是错误消息具有误导性,人们使用了错误的类型 ( Example Question )。

有人可以帮我解决我写的类型不正确吗?

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