当前位置:网站首页>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/
边栏推荐
- NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon
- Precautions for accompanying driving these 23 points should be paid attention to!
- MySQL indexes and transactions
- Definition of DCDC power supply current
- 疫情远程办公经验分享| 社区征文
- UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0x98 in position 1093: illegal multibyte sequence
- 十字路口通行优先权,十字路口通行规则图解
- @Feignclient comments and parameters
- Instructions for LPC interrupt binding under ft2000+
- Unity中RampTex介绍和应用: 溶解特效优化
猜你喜欢

浅谈JVM的那些事

博朗与Virgil Abloh于2021年为纪念博朗品牌100周年而联合打造的“功能性艺术”将在博物馆展出Abloh作品期间首次亮相

分享一些我的远程办公经验

YoloV6实战:手把手教你使用Yolov6进行物体检测(附数据集)

牛客小白月赛49

Architecture practice camp - graduation project of module 9 of phase 6

EventBridge 在 SaaS 企业集成领域的探索与实践

The five pictures tell you: why is there such a big gap between people in the workplace?

Rhcsa 04 - process management

RPC Technology
随机推荐
leetcode:1314. 矩阵区域和【二维前缀和模板】
CRS-4013: This command is not supported in a single-node configuration.
CRS-4013: This command is not supported in a single-node configuration.
Deep parsing structured exception handling (SEH) - by Matt Pietrek
Kivy教程之 更改背景颜色(教程含源码)
I.MX6U-ALPHA开发板(C语言版本LED驱动实验)
Pytest basic self-study series (I)
6-4漏洞利用-SSH Banner信息获取
Kivy tutorial 07 component and attribute binding implementation button button click to modify the label component (tutorial includes source code)
Leetcode 121 best time to buy and sell stock (simple)
Eig launched Grupo Cerro, a renewable energy platform in Chile
Annexe VI: exposé sur les travaux de défense. Docx
Application scheme of Puyuan ds1000z series digital oscilloscope in communication principle experiment
【云原生】那些看起来很牛X,原理却很简单的一行代码
ADB tools
YoloV6实战:手把手教你使用Yolov6进行物体检测(附数据集)
How do good test / development programmers practice? Where to go
Niuke Xiaobai monthly race 49
Instructions for LPC interrupt binding under ft2000+
Talking about what a high-quality little red book copy needs to have