Unlock instant, AI-driven research and patent intelligence for your innovation.

Scala-based data type comparison method and apparatus

A data type and type technology, applied in the computer field, can solve problems such as high error rate

Inactive Publication Date: 2017-07-07
BEIJING GRIDSUM TECH CO LTD
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The embodiment of the present application provides a method and device for comparing data types based on Scala, so as to at least solve the technical problem of high error rate when comparing single-precision floating-point data and double-precision floating-point data in the prior art

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Scala-based data type comparison method and apparatus
  • Scala-based data type comparison method and apparatus

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0019] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiment of the application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiment of the application. Obviously, the described embodiment is only It is an embodiment of a part of the application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.

[0020] It should be noted that the terms "first" and "second" in the description and claims of the present application and the above drawings are used to distinguish similar objects, but not necessarily used to describe a specific sequence or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances such...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a Scala-based data type comparison method and apparatus. The method comprises the steps of converting single-precision floating point data and double-precision floating point data into data of preset data types; and comparing the single-precision floating point data and the double-precision floating point data, which are converted into the data of the preset data types, to obtain a comparison result. According to the method and the apparatus, the technical problem of relatively high error rate during comparison of the single-precision floating point data and the double-precision floating point data is solved.

Description

technical field [0001] The present application relates to the computer field, in particular, to a Scala-based data type comparison method and device. Background technique [0002] In the Scala programming language, 0.96F is a single-precision floating-point (Float) type of data, while 0.96 is a double-precision floating-point (Double) type of data. Due to the difference in data types, when the user compares 0.96F==0.96, return The comparison results are all false (false). And in Scala programming language, 22.00F is the data of single-precision floating-point (Float) type, and 22.00 is the data of double-precision floating-point (Double) type, but when the user compares 22.00F==22.00, what returns is true. In the prior art, the data of the double-precision floating point (Double) type is often first converted into another data type, such as a string, and then the string is converted into the data of the single-precision floating point (Float) type, and converted into After...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F17/30
CPCG06F16/258
Inventor 汤卫群
Owner BEIJING GRIDSUM TECH CO LTD