Real Number Types
A double is always used because it provides the maximum precision to hold numbers for all of the types above.
The general mapping is as follows:
<xsd:simpleType name="TypeName"> <restriction base="xsd:float"/> </xsd:simpleType> typedef OSREAL TypeName; class TypeName : public OSRTBaseType { OSREAL value; ... } ;
The character representation of these numeric types in generated messages can be altered by using a configuration file. This allows behavior such as preservation of leading zeros to be specified.
The <typemap> declarations can be used to map a real number type or a list of real number types separated by space to a string type. This can be done at global or schema level. This mapping configuration can be used to preserve the format of floating point numbers after decoding and reencoding.
For example, to map xsd:double types to string:
<typemap> <xsdtype>double</xsdtype> <ctype>string</ctype> </typemap>
Copyright © Objective Systems 2002-2008 This document may be distributed in any form, electronic or otherwise, provided that it is distributed in its entirety and that the copyright and this notice are included. |
Objective Systems, Inc.55 Dowlin Forge RoadExton, Pennsylvania 19341 http://www.obj-sys.com Phone: (484) 875-9841 Toll-free: (877) 307-6855 (US only) Fax: (484) 875-9830 info@obj-sys.com |