当前位置:网站首页>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
- 软考高级(信息系统项目管理师)高频考点:项目质量管理
- Should novice programmers memorize code?
- 做国外LEAD2022年下半年几点建议
- 2014阿里巴巴web前实习生项目分析(1)
- sizeof关键字
- Config:invalid signature solution and troubleshooting details
- Research and investment strategy report of China's VOCs catalyst industry (2022 Edition)
- 关于声子和热输运计算中BORN电荷和non-analytic修正的问题
- 柔性数组到底如何使用呢?
猜你喜欢

Aardio - 不声明直接传float数值的方法

机试刷题1

Daily question 1: force deduction: 225: realize stack with queue

Pit encountered by handwritten ABA

二分图判定

AdaViT——自适应选择计算结构的动态网络

NetXpert XG2帮您解决“布线安装与维护”难题

Installation and use of labelimg

CCNA Cisco network EIGRP protocol

Memorabilia of domestic database in June 2022 - ink Sky Wheel
随机推荐
config:invalid signature 解决办法和问题排查详解
Jafka来源分析——Processor
Adavit -- dynamic network with adaptive selection of computing structure
extern关键字
【编译原理】做了一半的LR(0)分析器
2022-07-04 the high-performance database engine stonedb of MySQL is compiled and run in centos7.9
Memorabilia of domestic database in June 2022 - ink Sky Wheel
2022-07-05 stonedb sub query processing parsing time analysis
Should novice programmers memorize code?
The difference between enumeration and define macro
CocosCreator+TypeScripts自己写一个对象池
TypeScript获取函数参数类型
Attack and defense world miscall
手写ABA遇到的坑
【踩坑合辑】Attempting to deserialize object on CUDA device+buff/cache占用过高+pad_sequence
Assembly and Interface Technology Experiment 6 - ADDA conversion experiment, AD acquisition system in interrupt mode
labelimg的安装与使用
Build op-tee development environment based on qemuv8
Chapter 4: talk about class loader again
【LeetCode】19、 删除链表的倒数第 N 个结点