我正在尝试为**(未存在的)运算符创建一个通用函数,该运算符将计算左数字到正确数字的幂.
它适用于0和正数,但我想要处理负数.
我想到了几个想法,但我想尝试将现有运算符的功能存储在变量中,如下所示:
var operation = *
Run Code Online (Sandbox Code Playgroud)
要么
var operation = /
Run Code Online (Sandbox Code Playgroud)
使用operation(a, b)会像a*b或那样做a/b
在Swift中这样的事情可能吗?
当我编写此命令“npm run ios”时,出现此错误:
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening PhotoSearch.xcworkspace. Run CLI with --verbose flag for more details.
User defaults from command line:
IDEDerivedDataPathOverride = /Users/front.end.af/Documents/Nikita/kinoagenstvo/ios/build/PhotoSearch
note: Using new build system
note: Planning build
note: Constructing build description
Build system information
error: Multiple commands produce '/Users/front.end.af/Documents/Nikita/kinoagenstvo/ios/build/PhotoSearch/Build/Products/Debug-iphonesimulator/PhotoSearch.app/Zocial.ttf':
1) Target 'PhotoSearch' (project 'PhotoSearch') has copy command from '/Users/front.end.af/Documents/Nikita/kinoagenstvo/node_modules/react-native-vector-icons/Fonts/Zocial.ttf' …Run Code Online (Sandbox Code Playgroud)