简体   繁体   English

C# 十六进制浮点常数

[英]C# hexadecimal floating-point constants

I'd like to use some hexa floating point constants with exponents in C# as it is allowed in c++ For example: 0x1p+53 or 0x1.dcd651ep+29我想在 C# 中使用一些带指数的六进制浮点常量,因为它在 c++ 中是允许的 例如:0x1p+53 或 0x1.dcd651ep+29

Can't find a way how to translate this to C#.找不到如何将其转换为 C# 的方法。 I'm using VS2019我正在使用 VS2019

BTW i'm aware of the solution posted here with a workaround with C.Math lib (ldexp) but I'm using .net 5 and I can't rely on a .net 4.x lib.顺便说一句,我知道这里发布的解决方案是使用 C.Math 库(ldexp)的解决方法,但我使用的是 .net 5,我不能依赖 Z2D50972FCECD13706202954Z5507 库。

look like there's no other way than convert and use decimal values instead.看起来除了转换和使用十进制值之外别无他法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM