当前位置:网站首页>Checking whether the double value is an integer - Swift - checking if a double value is an integer - swift
Checking whether the double value is an integer - Swift - checking if a double value is an integer - swift
2022-06-25 10:48:00 【fyin1314】
problem :
I need to check if a double-defined variable is convertible to Int without losing its value. I need to check whether the double definition variable can be converted to Int Without losing its value .This doesn't work because they are of different types: It doesn't work , Because of their different types :
if self.value == Int(self.value)where self.value is a double. among self.value It's double self.value value .
Solution :
Reference resources : https://stackoom.com/en/question/1vMYO边栏推荐
- [paper reading | deep reading] drne:deep recursive network embedding with regular equivalence
- OODA working method
- Daily Mathematics Series 52: February 20
- 撸一个随机数生成器
- Linked list delete nodes in the linked list
- 虚幻引擎图文笔记:使用VAT(Vertex Aniamtion Texture)制作破碎特效(Houdini,UE4/UE5)上 Houdini端
- Flask博客实战 - 实现个人中心及权限管理
- Google Earth Engine(GEE)——evaluate實現一鍵批量下載研究區內的所有單張影像(上海市部分區域)
- Deep understanding of JVM - JVM memory model
- 单片机开发---基于ESP32-CAM的人脸识别应用
猜你喜欢

XSS attack

String implementation strstr()

网络远程访问的方式使用树莓派

Network protocol learning -- lldp protocol learning

1-7snapshots and clones in VMWare

ES 学习

【论文阅读|深度】Role-based network embedding via structural features reconstruction with degree-regularized

Houdini graphic notes: could not create OpenCL device of type (houdini_ocl_devicetype) problem solving

NETCORE performance troubleshooting

Kotlin arrays and collections (1) {create arrays, use arrays, use for in loops to traverse arrays, use array indexes, and multi-dimensional arrays}
随机推荐
垃圾回收机制
P2P network core technology: Gossip protocol
Houdini graphic notes: could not create OpenCL device of type (houdini_ocl_devicetype) problem solving
服务端渲染
2022-06-24:golang选择题,以下golang代码输出什么?A:1;B:3;C:4;D:编译失败。 package main import ( “fmt“ ) func mai
性能之文件系统篇
Oracle彻底卸载的完整步骤
Shardingsphere proxy 5.0 sub database and sub table (I)
Google Earth Engine(GEE)——evaluate实现一键批量下载研究区内的所有单张影像(上海市部分区域)
I'm afraid of the goose factory!
单片机开发---基于ESP32-CAM的人脸识别应用
Flask博客实战 - 实现侧边栏文章归档及标签
Google Earth engine (GEE) - evaluate enables one click batch download of all single images in the research area (some areas in Shanghai)
数组结构整理
WPF binding expression and binding data source (I)
[200 opencv routines] 210 Are there so many holes in drawing a straight line?
我希望按照我的思路尽可能将canvas基础讲明白
【论文阅读|深读】LINE: Large-scale Information Network Embedding
XSS attack
[RPC] i/o model - Rector mode of bio, NiO, AIO and NiO