当前位置:网站首页>在代碼中使用度量單比特,從而生活更美好
在代碼中使用度量單比特,從而生活更美好
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/
边栏推荐
- Kivy教程之 07 组件和属性绑定实现按钮button点击修改label组件(教程含源码)
- "Don't care too much about salary when looking for a job", this is the biggest lie I've ever heard
- RPC Technology
- What is context?
- Leader: who uses redis expired monitoring to close orders and get out of here!
- 分布式CAP理论
- Drozer tool
- DCDC电源电流定义
- Self sharing of a graduate
- Instructions for LPC interrupt binding under ft2000+
猜你喜欢

Virtual commodity account trading platform source code_ Support personal QR code collection

Redis: order collection Zset type data operation command

Statistical genetics: Chapter 3, population genetics

20000 words will take you to master multithreading

【云原生】那些看起来很牛X,原理却很简单的一行代码

Wechat official account infinite callback authorization system source code

6-4漏洞利用-SSH Banner信息获取

Experience sharing of epidemic telecommuting | community essay solicitation

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

Niuke Xiaobai monthly race 49
随机推荐
I.MX6U-ALPHA开发板(模仿STM32驱动开发实验)
Keysight n9320b RF spectrum analyzer solves tire pressure monitoring scheme
Cmake compilation option setting in ros2
Y55. Chapter III kubernetes from entry to proficiency -- HPA controller and metrics server (28)
附件一:202x年xxx攻防演习授权委托书
Talking about what a high-quality little red book copy needs to have
Precautions for accompanying driving these 23 points should be paid attention to!
Leader: who uses redis expired monitoring to close orders and get out of here!
最长递增子序列问题(你真的会了吗)
@Feignclient comments and parameters
FT2000+下LPC中断绑核使用说明
【愚公系列】2022年7月 Go教学课程 002-Go语言环境安装
Deep understanding of redis -- bloomfilter
附件五:攻击过程简报.docx
Network - vxlan
Wechat brain competition answer applet_ Support the flow main belt with the latest question bank file
Balloon punching and Boolean operation problems (extremely difficult)
Why use node
Asahi Kasei participated in the 5th China International Import Expo (5th ciie) for the first time
Deep parsing structured exception handling (SEH) - by Matt Pietrek