当前位置:网站首页>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);
边栏推荐
- Spatial domain and frequency domain image compression of images
- Signed and unsigned keywords
- 自定义 swap 函数
- Memorabilia of domestic database in June 2022 - ink Sky Wheel
- ThreadLocal详解
- How big is the empty structure?
- Lora sync word settings
- LeetCode 练习——剑指 Offer 26. 树的子结构
- Plafond du tutoriel MySQL, bien collecté, regardez lentement
- go多样化定时任务通用实现与封装
猜你喜欢
机试刷题1
Assembly and Interface Technology Experiment 6 - ADDA conversion experiment, AD acquisition system in interrupt mode
Senior soft test (Information System Project Manager) high frequency test site: project quality management
Sword finger offer question brushing record 1
Installation and use of labelimg
Self made j-flash burning tool -- QT calls jlinkarm DLL mode
基于 QEMUv8 搭建 OP-TEE 开发环境
uniapp滑动到一定的高度后固定某个元素到顶部效果demo(整理)
在IPv6中 链路本地地址的优势
Notes de développement du matériel (10): flux de base du développement du matériel, fabrication d'un module USB à RS232 (9): création de la Bibliothèque d'emballage ch340g / max232 SOP - 16 et Associa
随机推荐
uniapp滑动到一定的高度后固定某个元素到顶部效果demo(整理)
【LeetCode】19、 删除链表的倒数第 N 个结点
MySQL ---- first acquaintance with MySQL
Windows Auzre 微软的云计算产品的后台操作界面
sizeof关键字
Adavit -- dynamic network with adaptive selection of computing structure
新手程序员该不该背代码?
General implementation and encapsulation of go diversified timing tasks
树的先序中序后序遍历
The difference between enumeration and define macro
柔性数组到底如何使用呢?
Data storage (1)
Chapter 4: talk about class loader again
Aardio - 通过变量名将变量值整合到一串文本中
CocosCreator+TypeScripts自己写一个对象池
RESNET rs: Google takes the lead in tuning RESNET, and its performance comprehensively surpasses efficientnet series | 2021 arXiv
Lora sync word settings
Comparison between variable and "zero value"
Crawler obtains real estate data
2014阿里巴巴web前实习生项目分析(1)