当前位置:网站首页>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);
边栏推荐
- ThreadLocal详解
- pytorch_YOLOX剪枝【附代码】
- uniapp设置背景图效果demo(整理)
- 将MySQL的表数据纯净方式导出
- Gd32f4xx serial port receive interrupt and idle interrupt configuration
- 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
- 在IPv6中 链路本地地址的优势
- Data storage (1)
- 剪映+json解析将视频中的声音转换成文本
- MySQL教程的天花板,收藏好,慢慢看
猜你喜欢
如何用程序确认当前系统的存储模式?
Installation and use of labelimg
【LeetCode】19、 删除链表的倒数第 N 个结点
NPDP认证|产品经理如何跨职能/跨团队沟通?
第3章:类的加载过程(类的生命周期)详解
HDR image reconstruction from a single exposure using deep CNN reading notes
labelimg的安装与使用
剪映+json解析将视频中的声音转换成文本
基于 QEMUv8 搭建 OP-TEE 开发环境
Learn the principle of database kernel from Oracle log parsing
随机推荐
Sizeof keyword
Crawler obtains real estate data
SQL server generates auto increment sequence number
NPDP certification | how do product managers communicate across functions / teams?
Web APIs DOM time object
Unity3d minigame unity webgl transform plug-in converts wechat games to use dlopen, you need to use embedded 's problem
rust知识思维导图xmind
Data storage (1)
Inno setup packaging and signing Guide
MySQL----初识MySQL
sizeof关键字
How do I write Flask's excellent debug log message to a file in production?
Aardio - 利用customPlus库+plus构造一个多按钮组件
小程序系统更新提示,并强制小程序重启并使用新版本
What are the specific steps and schedule of IELTS speaking?
C# 三种方式实现Socket数据接收
【无标题】
GD32F4XX串口接收中断和闲时中断配置
机试刷题1
Export MySQL table data in pure mode