comparison src/oct-stream.cc @ 5389:25c8956d2204

[project @ 2005-06-15 03:45:46 by jwe]
author jwe
date Wed, 15 Jun 2005 03:45:49 +0000
parents df230b7df93c
children 7bdddf96f028
comparison
equal deleted inserted replaced
5388:7099eb9841b4 5389:25c8956d2204
68 68
69 double dval = tc.double_value (); 69 double dval = tc.double_value ();
70 70
71 if (! error_state) 71 if (! error_state)
72 { 72 {
73 if (! lo_ieee_is_NaN_or_NA (dval)) 73 if (! lo_ieee_isnan (dval))
74 { 74 {
75 int ival = NINT (dval); 75 int ival = NINT (dval);
76 76
77 if (ival == dval) 77 if (ival == dval)
78 retval = ival; 78 retval = ival;
91 static int 91 static int
92 get_size (double d, const std::string& who) 92 get_size (double d, const std::string& who)
93 { 93 {
94 int retval = -1; 94 int retval = -1;
95 95
96 if (! lo_ieee_is_NaN_or_NA (d)) 96 if (! lo_ieee_isnan (d))
97 { 97 {
98 if (! xisinf (d)) 98 if (! xisinf (d))
99 { 99 {
100 if (d >= 0.0) 100 if (d >= 0.0)
101 retval = NINT (d); 101 retval = NINT (d);
2556 { 2556 {
2557 double val = val_cache.double_value (); 2557 double val = val_cache.double_value ();
2558 2558
2559 if (val_cache) 2559 if (val_cache)
2560 { 2560 {
2561 if (lo_ieee_is_NaN_or_NA (val) || xisinf (val) 2561 if (lo_ieee_isnan (val) || xisinf (val)
2562 || ((val > INT_MAX || val < INT_MIN) 2562 || ((val > INT_MAX || val < INT_MIN)
2563 && (elt->type == 'd' 2563 && (elt->type == 'd'
2564 || elt->type == 'i' 2564 || elt->type == 'i'
2565 || elt->type == 'c' 2565 || elt->type == 'c'
2566 || elt->type == 'o' 2566 || elt->type == 'o'
2568 || elt->type == 'X' 2568 || elt->type == 'X'
2569 || elt->type == 'u'))) 2569 || elt->type == 'u')))
2570 { 2570 {
2571 std::string tfmt = fmt; 2571 std::string tfmt = fmt;
2572 2572
2573 if (lo_ieee_is_NaN_or_NA (val) || xisinf (val)) 2573 if (lo_ieee_isnan (val) || xisinf (val))
2574 { 2574 {
2575 tfmt.replace (tfmt.rfind (elt->type), 1, 1, 's'); 2575 tfmt.replace (tfmt.rfind (elt->type), 1, 1, 's');
2576 2576
2577 const char *tval = xisinf (val) 2577 const char *tval = xisinf (val)
2578 ? (val < 0 ? "-Inf" : "Inf") 2578 ? (val < 0 ? "-Inf" : "Inf")