草庐IT

double-elimination

全部标签

json - 在 Flutter 和 Dart 中从 JSON 解析 double 值

我在尝试从Flutter中的JSON获取double值时遇到问题。classMapPoint{Stringtitle;doublelat;doublelng;MapPoint({this.title,this.lat,this.lng});factoryMapPoint.fromJson(Mapjson){returnMapPoint(title:json["title"]asString,lat:json["lat"]asdouble,lng:json["lng"]asdouble);}}由于某些原因我得到了错误DartError:Unhandledexception:type'do

flutter - Sliver Appbar "eliminates"原色

我有一个简单的银色应用栏,我将我的主要颜色设置为:theme:ThemeData(primaryColor:Color.fromRGBO(50,50,205,1)),在我添加sliverappbar之前,所有屏幕都设置为原色,但是在我添加了sliverappbar之后,屏幕突然变白了。如何设置我的原色以填充屏幕?这是一个非常简单的sliverappbar,如果你需要这个的代码让我知道 最佳答案 仍然不知道为什么会这样,但我找到了解决方案。只需用容器包裹剩余的屏幕并像这样添加颜色:SliverFillRemaining(child:C

Dart或Flutter如何读取一个float32 little endian编码的二进制文件并转换成List<double>?

我正在使用file.readAsBytes()。但它只提供List来接收数据。我正在尝试Uint8List但没有用。 最佳答案 readAsBytes将为您提供字节列表。它可能是一个Uint8List或者可能只是一个List.(如果不是Uint8List,使用Uint8List.fromList(anotherByteArray)转换它。)然后使用:ulist.buffer.asFloat32List() 关于Dart或Flutter如何读取一个float32littleendian编码

dart - 如何在 Dart 中拆分 Double 值?

我想将两个变量分配给double上的整数和小数部分。怎么做? 最佳答案 一种方式是intx=abc.toInt()inty=int.tryParse(abc.toString().split('.')[1]); 关于dart-如何在Dart中拆分Double值?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/55160793/

google-api - 使用 double.parse() 在 Dart 中将字符串转换为 double

我正在尝试转换从GoogleGeo返回的坐标。API成double。返回的响应的简化部分是...{locationData:{bounds:{northeast:40.222222,southwest:38.265987}}}当我使用print(locationData['bounds']['northeast'])时,我的控制台读取并理解该值为40.222222但是,当我尝试使用解析方法时,出现以下错误:varneLat=double.parse(locationData['bounds']['northeast']);I/flutter(10537):type'double'isn

java - 为什么android SQLite可以将 double 值(java 8字节)存储到浮点列中

CreateTable:db.execSQL("CREATETABLE"+PERSONS_TABLE+"("+PersonsColumns.ID+"INTEGERPRIMARYKEYAUTOINCREMENT,"...+PersonsColumns.HEIGHT+"FLOAT,"+PersonsColumns.CITY+"STRING);");WriteData:ContentValuesvalues=newContentValues();alues.put(PersonsColumns.HEIGHT,1.7976931348623157E308);db.insertOrIgnore(

entity-framework - 为什么 "real"和 "float"都映射到 "Single"而不是 "Double"?

我在模型优先模式(=EDMX)中使用System.Data.SQLite1.0.90与VS2013和EntityFramework5。我创建了一个包含表的新SQLite数据库:CREATETABLE[..][Test1integer]integer,[Test2int]int,[Test3smallint]smallint,[Test4tinyint]tinyint,[Test5bigint]bigint,[Test6money]money,[Test7float]float,[Test8real]real,[Test9decimal]decimal,[Test10numeric18_

swift - 在 swift 中比 double 更精确

Swift中是否有比Double更准确的float?我知道在C中有longdouble,但我似乎无法在Apple的新编程语言中找到它的等价物。如有任何帮助,我们将不胜感激! 最佳答案 是的,有!Float80正是为此而设计的,它存储80位(duh),10个字节。您可以像使用任何其他浮点类型一样使用它。请注意,Swift中有Float32、Float64和Float80,其中Float32只是的类型别名Float和Float64是Double 关于swift-在swift中比double更

swift 3 :fatal error: Double value cannot be converted to Int because it is either infinite or NaN

当我调用这个方法时,收到一个错误。如何在分配给小时、分钟或秒时处理NaN或无限值?这是我的代码:privatefuncsecondsToFormattedString(totalSeconds:Float64)->String{lethours:Int=Int(totalSeconds.truncatingRemainder(dividingBy:86400)/3600)letminutes:Int=Int(totalSeconds.truncatingRemainder(dividingBy:3600)/60)letseconds:Int=Int(totalSeconds.trunc

swift - 添加字典 swift 3 中包含的 double

我正在学习一些关于Swift的知识,并且正在学习Udemy类(class)。该类(class)是用swift2教授的,我使用的是swift3,所以我希望了解输出的差异,但到目前为止我在网上找不到任何答案。我有一个字典项目,其中包含3个东西。varmenu=["entre":5.55,"main-meal":20.50,"desert":5.50]想法是使用instructors输出将3个值相加(在swift2中工作正常):vartotalCost=menu["entre"]!+menu["desert"]!+menu["main-meal"]!在类(class)中,这工作得很好,但对我