当前位置:网站首页>在代碼中使用度量單比特,從而生活更美好
在代碼中使用度量單比特,從而生活更美好
2022-07-04 04:49:00 【dotNET跨平臺】
在我們的應用軟件中,涉及到物理化學計算時,只有 Frink 、F#、Modelica 少數語言變量是自帶單比特的,大部分語言變量僅包含數值,單比特轉換需要在變量進行公式計算之前完成,計算後再把結果單比特轉換為輸出單比特,單比特轉換主要通過若幹常數實現。這帶來了兩個問題:
大量常數降低代碼可讀性和維護性;
計算精度難以保障。
UnitsNet 用具有單比特的變量替代double,支持單比特的自動轉換,並(部分)支持不同單比特的乘除計算。使用UnitsNet 寫公式計算代碼,可以避免直接的單比特轉換,使程序的調用者可以使用任意單比特作為輸入。在.NET IoT 將 UnitsNet 用於任何傳感器在綁定中公開的任何單元。在文檔裏有明確的設備 API 的約定:https://github.com/dotnet/iot/blob/main/Documentation/Devices-conventions.md
相關參考文章:
理化計算程序必備:CoolProp+UnitsNet:https://blog.csdn.net/xhydongda/article/details/120663619
深入研究 .NET NANOFRAMEWORK 的一年:https://www.nanoframework.net/laurent-ellerbach-a-year-deeply-in-net-nanoframework/
边栏推荐
- MySQL indexes and transactions
- Rhcsa 04 - process management
- Qt QTableView数据列宽度自适应
- UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0x98 in position 1093: illegal multibyte sequence
- [security attack and Defense] how much do you know about serialization and deserialization?
- Application scheme of Puyuan ds1000z series digital oscilloscope in communication principle experiment
- Krypton saikr daily question - CTF
- Deep understanding of redis -- bloomfilter
- How to view installed r packages in R language
- 最长递增子序列问题(你真的会了吗)
猜你喜欢
Developing mqtt access program under QT
测试 CS4344 立体声DA转换器
[Yugong series] go teaching course 002 go language environment installation in July 2022
6-5漏洞利用-SSH弱口令破解利用
I.MX6U-ALPHA开发板(C语言版本LED驱动实验)
qt下开发mqtt的访问程序
Kivy教程之 更改背景颜色(教程含源码)
Imitation of "game bird" source code, mobile game issue evaluation, open service, open test collection, game download website template
Intersection traffic priority, illustration of intersection traffic rules
[security attack and Defense] how much do you know about serialization and deserialization?
随机推荐
Kivy教程之 自定义字体(教程含源码)
Rhcsa 08 - automount configuration
Developing mqtt access program under QT
GUI 应用:socket 网络聊天室
戳气球和布尔运算问题(巨难)
Apple CMS imitation watermelon video atmospheric response video template source code
MySQL 索引和事务
关闭的数据能用dbca删除吗? 能
6-4 vulnerability exploitation SSH banner information acquisition
附件2-2保密承诺书.docx
Exploration and practice of eventbridge in the field of SaaS enterprise integration
Change the background color of Kivy tutorial (tutorial includes source code)
Kivy tutorial 07 component and attribute binding implementation button button click to modify the label component (tutorial includes source code)
Architecture practice camp - graduation project of module 9 of phase 6
Balloon punching and Boolean operation problems (extremely difficult)
分享一些我的远程办公经验
rac删除损坏的磁盘组
Wechat brain competition answer applet_ Support the flow main belt with the latest question bank file
A beautiful API document generation tool
Create ASM disk through DD