当前位置:网站首页>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);
边栏推荐
- [Digital IC hand tearing code] Verilog burr free clock switching circuit | topic | principle | design | simulation
- C# 三种方式实现Socket数据接收
- What are the specific steps and schedule of IELTS speaking?
- 2022-07-05 stonedb的子查询处理解析耗时分析
- Void keyword
- pytorch_YOLOX剪枝【附代码】
- Comparison between variable and "zero value"
- CCNA Cisco network EIGRP protocol
- How to confirm the storage mode of the current system by program?
- return 关键字
猜你喜欢

Clip +json parsing converts the sound in the video into text

Chapter 3: detailed explanation of class loading process (class life cycle)

Mise en place d'un environnement de développement OP - tee basé sur qemuv8

C# 三种方式实现Socket数据接收

Adavit -- dynamic network with adaptive selection of computing structure

(18) LCD1602 experiment

树的先序中序后序遍历

Assembly and Interface Technology Experiment 6 - ADDA conversion experiment, AD acquisition system in interrupt mode

rust知识思维导图xmind

pytorch_YOLOX剪枝【附代码】
随机推荐
Puppeteer连接已有Chrome浏览器
0 basic learning C language - digital tube
(18) LCD1602 experiment
Aardio - 不声明直接传float数值的方法
POJ 1258 Agri-Net
剪映+json解析将视频中的声音转换成文本
Is there any requirement for the value after the case keyword?
UE4蓝图学习篇(四)--流程控制ForLoop和WhileLoop
Data storage (1)
OpenNMS分离数据库
基于 QEMUv8 搭建 OP-TEE 开发环境
Export MySQL table data in pure mode
云原生技术--- 容器知识点
Gd32f4xx serial port receive interrupt and idle interrupt configuration
Crawler obtains real estate data
Config:invalid signature solution and troubleshooting details
China 1,4-cyclohexanedimethanol (CHDM) industry research and investment decision-making report (2022 Edition)
Web APIs DOM 时间对象
12、 Start process
How big is the empty structure?