01: /*
02: * StrtodResult.java --
03: *
04: * Stores the result of the Util.strtod() method.
05: *
06: * Copyright (c) 1997 Cornell University.
07: * Copyright (c) 1997 Sun Microsystems, Inc.
08: *
09: * See the file "license.terms" for information on usage and
10: * redistribution of this file, and for a DISCLAIMER OF ALL
11: * WARRANTIES.
12: *
13: * RCS: @(#) $Id: StrtodResult.java,v 1.3 2005/11/19 01:09:06 mdejong Exp $
14: *
15: */
16:
17: package tcl.lang;
18:
19: /*
20: * This class stores the result of the Util.strtod() method.
21: */
22:
23: class StrtodResult {
24:
25: /*
26: * If the conversion is successful, errno = 0;
27: *
28: * If the number cannot be converted to a valid signed 64-bit double,
29: * contains the error code (TCL.DOUBLE_RANGE or TCL.UNVALID_DOUBLE).
30: */
31:
32: int errno;
33:
34: /*
35: * If errno is 0, points to the character right after the number
36: */
37:
38: int index;
39:
40: /*
41: * If errno is 0, contains the value of the number.
42: */
43:
44: double value;
45:
46: // Update a StrtodResult. Note that there is typically
47: // just one StrtodResult for each interp.
48:
49: void update(double v, // value for the value field.
50: int i, // value for the index field.
51: int e) // value for the errno field.
52: {
53: value = v;
54: index = i;
55: errno = e;
56: }
57:
58: } // end StrtodResult
|