This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

# %Library.Double

datatype class %Library.Double extends %Library.DataType

ODBC Type: DOUBLE

The %Library.Double data type class represents a IEEE double-precision (64-bit) floating point number.

The logical value of the %Double data type is a IEEE floating point value.

## Parameters

parameter DISPLAYLIST;
Used for enumerated (multiple-choice) attributes. Used in conjunction with the VALUELIST parameter for enumerated (multiple-choice) attributes. DISPLAYLIST, if not null, represents the display values for the attribute corresponding with the logical values listed in VALUELIST.

The display values are returned by the LogicalToDisplay method.

parameter FORMAT;
The format specification for the data type's display value.

The value of FORMAT corresponds to the formatting option of the `\$FNUMBER` function, which is used to perform the formatting.

parameter MAXVAL;
The maximum allowed logical value for the data type.
parameter MINVAL;
The minimum allowed logical value for the data type.
parameter SCALE;
The scale value (number of digits following the decimal point) for this data type. This parameter only affects the display value which will be rounded to the specified number of decimal places.
parameter VALUELIST;
Used for enumerated (multiple-choice) attributes. VALUELIST is either a null string ("") or a delimiter separated list (where the delimiter is the first character) of logical values. If a non-null value is present, then the attribute is restricted to values in the list, and the validation code simply checks to see if the value is in the list.
parameter XSDTYPE = double;
Declares the XSD type used when projecting XML Schemas.

## Methods

classmethod DisplayToLogical(%val As %String) as %Double
Converts the input value %val, which is a string representing a floating point value, into a logical floating point value.

Returns the logical floating point value of the input string %val.

classmethod IsValid(%val As %CacheString) as %Status
Tests if the logical value %val, which is a floating point value, is valid. The validation is based on the class parameter settings used for the class attribute this data type is associated with. In this case, MAXVAL and MINVAL.
classmethod LogicalToDisplay(%val As %Double) as %String
Converts the value of %val, which is in logical floating point format, into a display string. The formatting is based on the value of the FORMAT parameter.

Returns the formatted value of %val.

classmethod LogicalToXSD(%val As %Double) as %String
Converts the Cache IEEE floating point value to the canonical SOAP encoded double value. In particular, the values NaN, -INF and +INF are used with that case.
classmethod Normalize(%val As %CacheString) as %Double
Converts %val to a normalized value.
classmethod OdbcToLogical(%val As %CacheString) as %Double
Converts %val to a normalized value upon conversion from Odbc to Logical mode
classmethod XSDToLogical(%val As %String) as %Double
Converts the SOAP encoded input decimal value into a Cache IEEE floating point value. Returns "" for error.
{"ft_lang_label":"__label__en","ft_lang_prob":0.57652396,"math_prob":0.93395686,"size":3017,"snap":"2021-04-2021-17","text_gpt3_token_len":635,"char_repetition_ratio":0.1563226,"word_repetition_ratio":0.07964602,"special_character_ratio":0.19522704,"punctuation_ratio":0.106796116,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.950503,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-04-12T19:50:42Z\",\"WARC-Record-ID\":\"<urn:uuid:f864d107-fbbd-4cda-9bbe-22ff08504402>\",\"Content-Length\":\"70356\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:97c4514a-0850-4c8d-a4bc-eb5b502b9444>\",\"WARC-Concurrent-To\":\"<urn:uuid:e48ac106-4070-4d9d-9603-02a7936d2822>\",\"WARC-IP-Address\":\"198.133.74.116\",\"WARC-Target-URI\":\"https://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?&LIBRARY=%25SYS&CLASSNAME=%25Library.Double\",\"WARC-Payload-Digest\":\"sha1:7ESEUBWHJ4MERDMNL5WOKSTEPBV4JK43\",\"WARC-Block-Digest\":\"sha1:Y57KFJHEMFHZONGHH47IU7XIF52GO6R2\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-17/CC-MAIN-2021-17_segments_1618038069133.25_warc_CC-MAIN-20210412175257-20210412205257-00437.warc.gz\"}"}