当前位置:网站首页>Aardio - does not declare the method of directly passing float values
Aardio - does not declare the method of directly passing float values
2022-07-06 22:31:00 【Lu Guangqing】
The content of this article has been sorted to :
Aardio - API Call analysis _ Luguangqing's blog -CSDN Blog _aardio
Because I think there is less relevant information , I hereby send another message , For reference .
because aardio Call directly without declaration dll When , This is how to deal with numerical parameters :
All numerical parameters are treated as 32 position int integer .( Less than 32 An integer 、 Enumeration type 、8 Bit or 32 position bool All values follow int 32 Digit values are compatible )
therefore , If you want to pass float data type , How to deliver ?
Here are two dll Function to test :
aardio The calling code is as follows ( The test process is not explained in detail , Let's go straight to the results ):
import console;
var dll=..raw.loadDll("\show.dll")
// Value transfer test :
// Numerical data structure
dll.show_byvalue(123.456)
// error (float It is automatically processed as an integer type when passing , The value has changed )
dll.show_byvalue(..raw.float(123.456))
// correct ( Constructed as decimal type ,aardio Automatically recognize and automatically adjust the parameter type to float)
// Addressable data structure
dll.show_byvalue({float v=123.456})
// error ( The message is “ Address ”, No “ The number ”, Values are not the same )
dll.show_byvalue(..raw.float(123.456,true))
// error ( The message is “ Address ”, No “ The number ”, Values are not the same )
// Numerical type , Data type conversion , take float Change the value to int The number , Then pass
dll.show_byvalue(raw.convert({ float f = 123.456 },{int i}).i)
// correct ( use int The number , forge float Type of memory data , Can be dll Correctly resolve to float The number . The principle is the same as union)
// All in all , It is necessary to put the right “ value ” Pass on the past .
// Address test :
// Numerical data structure
dll.show_byaddr(123.456)
// error , Illegal address , Abnormal protection , Program exit
dll.show_byaddr(..raw.float(123.456))
// error , Illegal address , Abnormal protection , Program exit
// Addressable data structure
dll.show_byaddr({float v=123.456})
// correct
dll.show_byaddr(..raw.float(123.456,true))
// correct
// Addressing is relatively simple , Other methods are not tested one by one .
console.pause(true);
边栏推荐
- CCNA Cisco network EIGRP protocol
- 2022-07-05 stonedb的子查询处理解析耗时分析
- 软考高级(信息系统项目管理师)高频考点:项目质量管理
- How big is the empty structure?
- 重磅新闻 | Softing FG-200获得中国3C防爆认证 为客户现场测试提供安全保障
- Chapter 4: talk about class loader again
- Should novice programmers memorize code?
- pytorch_YOLOX剪枝【附代码】
- 2014阿里巴巴web前实习生项目分析(1)
- 0 basic learning C language - digital tube
猜你喜欢
[Digital IC hand tearing code] Verilog burr free clock switching circuit | topic | principle | design | simulation
Leetcode exercise - Sword finger offer 26 Substructure of tree
树的先序中序后序遍历
Config:invalid signature solution and troubleshooting details
新手程序员该不该背代码?
手写ABA遇到的坑
[线性代数] 1.3 n阶行列式
Export MySQL table data in pure mode
剪映+json解析将视频中的声音转换成文本
signed、unsigned关键字
随机推荐
OpenNMS分离数据库
uniapp滑动到一定的高度后固定某个元素到顶部效果demo(整理)
2022-07-05 stonedb的子查询处理解析耗时分析
Hardware development notes (10): basic process of hardware development, making a USB to RS232 module (9): create ch340g/max232 package library sop-16 and associate principle primitive devices
pytorch_ Yolox pruning [with code]
每日一题:力扣:225:用队列实现栈
Dealing with the crash of QT quick project in offscreen mode
12、 Start process
2022-07-05 use TPCC to conduct sub query test on stonedb
2022-07-04 the high-performance database engine stonedb of MySQL is compiled and run in centos7.9
Netxpert xg2 helps you solve the problem of "Cabling installation and maintenance"
Plafond du tutoriel MySQL, bien collecté, regardez lentement
Aardio - 通过变量名将变量值整合到一串文本中
Sizeof keyword
signed、unsigned关键字
Is there any requirement for the value after the case keyword?
Unity3d minigame-unity-webgl-transform插件转换微信小游戏报错To use dlopen, you need to use Emscripten‘s...问题
Build op-tee development environment based on qemuv8
Sword finger offer question brushing record 1
NetXpert XG2帮您解决“布线安装与维护”难题