简体   繁体   English

是 double 和 Double 在 dart 中是不同的东西,如果是,谁能解释我

[英]is double and Double are different thing in dart and if it is can anyone explain me

as we can see this gives an error that is telling that 0.0 is double that can't assigned to Double datatype正如我们所看到的,这给出了一个错误,表明 0.0 是无法分配给 Double 数据类型的双精度

then i tried Double as datatype and my code worked fine.然后我尝试将 Double 作为数据类型,我的代码运行良好。 but i don't understand what is going on here so can any one tell me what is going on here?但我不明白这里发生了什么所以有人可以告诉我这里发生了什么吗?

Double comes from dart ffi, Double来自 dart ffi,

Represents a native 64 bit double in C. Double is not constructible in the Dart code and serves purely as marker in type signatures.表示 C 中的本机 64 位双精度数。双精度数在 Dart 代码中不可构造,纯粹用作类型签名中的标记。

you mostly don't want it, use double instead.您大多不想要它,请改用double

Find more about numbers in dart and dart-ffi/Double在 dartdart-ffi/Double中找到更多关于数字的信息

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

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