当前位置:网站首页>Use units of measure in your code for a better life
Use units of measure in your code for a better life
2022-07-04 04:50:00 【Dotnet cross platform】
In our application software , When it comes to physical and chemical calculations , Only Frink 、F#、Modelica A few language variables have their own units , Most language variables contain only numeric values , Unit conversion needs to be completed before formula calculation of variables , After calculation, the result unit is converted into output unit , Unit conversion is mainly realized by several constants . This raises two questions :
A large number of constants reduce code readability and maintainability ;
Calculation accuracy is difficult to guarantee .
UnitsNet Replace with variables with units double, Support automatic conversion of units , and ( part ) Support multiplication and division calculation of different units . Use UnitsNet Write formula calculation code , It can avoid direct unit conversion , So that the caller of the program can use any unit as input . stay .NET IoT take UnitsNet For any unit exposed by any sensor in the binding . There is a clear device in the document API The agreement of :https://github.com/dotnet/iot/blob/main/Documentation/Devices-conventions.md
Related reference articles :
Necessary for physical and chemical calculation program :CoolProp+UnitsNet:https://blog.csdn.net/xhydongda/article/details/120663619
Further study of .NET NANOFRAMEWORK In the year :https://www.nanoframework.net/laurent-ellerbach-a-year-deeply-in-net-nanoframework/
边栏推荐
- Rhcsa 04 - process management
- 附件2-2保密承诺书.docx
- [Yugong series] go teaching course 002 go language environment installation in July 2022
- 红队视角下的防御体系突破之第一篇介绍、阶段、方法
- 6-4漏洞利用-SSH Banner信息获取
- Niuke Xiaobai monthly race 49
- Zhengzhou zhengqingyuan Culture Communication Co., Ltd.: seven marketing skills for small enterprises
- [go] database framework Gorm
- Rhcsa 03 - Basic permissions for documents
- AcWing第 58 场周赛
猜你喜欢
Exploration and practice of eventbridge in the field of SaaS enterprise integration
Apple CMS imitation watermelon video atmospheric response video template source code
十字路口通行优先权,十字路口通行规则图解
The five pictures tell you: why is there such a big gap between people in the workplace?
Main applications of TDK lambda power supply
Unity中RampTex介绍和应用: 溶解特效优化
附件六:防守工作简报.docx
Distributed cap theory
6-5漏洞利用-SSH弱口令破解利用
浅谈JVM的那些事
随机推荐
Architecture practice camp - graduation project of module 9 of phase 6
软件设计文档示例模板 - 学习/实践
附件六:防守工作简报.docx
YoloV6实战:手把手教你使用Yolov6进行物体检测(附数据集)
Redis: operation command for collecting set type data
Operate the server remotely more gracefully: the practice of paramiko Library
6-5 vulnerability exploitation SSH weak password cracking and utilization
A beautiful API document generation tool
"Don't care too much about salary when looking for a job", this is the biggest lie I've ever heard
沃博联结束战略评估,决定保留表现优异的博姿业务
Self sharing of a graduate
Annexe VI: exposé sur les travaux de défense. Docx
Formatted text of Kivy tutorial (tutorial includes source code)
Wobo Union ended its strategic evaluation and decided to retain Bozi's business with excellent performance
Kivy tutorial 07 component and attribute binding implementation button button click to modify the label component (tutorial includes source code)
First knowledge of batch processing
Rhcsa 01 - create partitions and file systems
Pytest basic self-study series (I)
Application scheme of Puyuan ds1000z series digital oscilloscope in communication principle experiment
Annex V: briefing on the attack process docx