ooRexx  4.2.0-source
About: ooRexx (Open Object Rexx) is a free implementation of Object Rexx. Object Rexx is an enhancement of the classic Rexx interpreter; a full-featured programming language with a human-oriented syntax.
  Fossies Dox: ooRexx-4.2.0-source.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

Numerics.cpp
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */
4 /* Copyright (c) 2005-2009 Rexx Language Association. All rights reserved. */
5 /* */
6 /* This program and the accompanying materials are made available under */
7 /* the terms of the Common Public License v1.0 which accompanies this */
8 /* distribution. A copy is also available at the following address: */
9 /* http://www.ibm.com/developerworks/oss/CPLv1.0.htm */
10 /* */
11 /* Redistribution and use in source and binary forms, with or */
12 /* without modification, are permitted provided that the following */
13 /* conditions are met: */
14 /* */
15 /* Redistributions of source code must retain the above copyright */
16 /* notice, this list of conditions and the following disclaimer. */
17 /* Redistributions in binary form must reproduce the above copyright */
18 /* notice, this list of conditions and the following disclaimer in */
19 /* the documentation and/or other materials provided with the distribution. */
20 /* */
21 /* Neither the name of Rexx Language Association nor the names */
22 /* of its contributors may be used to endorse or promote products */
23 /* derived from this software without specific prior written permission. */
24 /* */
25 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
26 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
27 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
28 /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
29 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
30 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
31 /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
32 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
33 /* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
34 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
35 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
36 /* */
37 /*----------------------------------------------------------------------------*/
38 /******************************************************************************/
39 /* REXX Kernel */
40 /* */
41 /* Utility class to manage the various sorts of numeric conversions required */
42 /* by Rexx. These conversions are all just static methods. */
43 /* */
44 /******************************************************************************/
45 
46 #include "RexxCore.h"
47 #include "Numerics.hpp"
48 #include "NumberStringClass.hpp"
49 #include "IntegerClass.hpp"
50 #include <limits.h>
51 
52 #ifdef __REXX64__
53 const wholenumber_t Numerics::MAX_WHOLENUMBER = __INT64_C(999999999999999999);
54 const wholenumber_t Numerics::MIN_WHOLENUMBER = __INT64_C(-999999999999999999);
55  // the digits setting used internally for function/method arguments to allow
56  // for the full range
57 const size_t Numerics::ARGUMENT_DIGITS = ((size_t)18);
58 // this is the digits setting for full size binary settings
59 const size_t Numerics::SIZE_DIGITS = ((size_t)20);
60 
61 
62 /* Array for valid whole number at various digits settings */
63 /* for value 1-18. */
65  100,
66  1000,
67  10000,
68  100000,
69  1000000,
70  10000000,
71  100000000,
72  1000000000,
73  10000000000,
74  100000000000,
75  1000000000000,
76  10000000000000,
77  100000000000000,
78  1000000000000000,
79  10000000000000000,
80  100000000000000000,
81  1000000000000000000};
82 #else
84 const wholenumber_t Numerics::MIN_WHOLENUMBER = -999999999;
85  // the digits setting used internally for function/method arguments to allow
86  // for the full binary value range
87 const size_t Numerics::ARGUMENT_DIGITS = ((size_t)9);
88 // this is the digits setting for full size binary settings
89 const size_t Numerics::SIZE_DIGITS = ((size_t)10);
90 
91 
92 /* Array for valid whole number at various digits settings */
93 /* for value 1-9. */
95  100,
96  1000,
97  10000,
98  100000,
99  1000000,
100  10000000,
101  100000000,
102  1000000000};
103 #endif
104 
105 const wholenumber_t Numerics::MAX_EXPONENT = 999999999;
106 const wholenumber_t Numerics::MIN_EXPONENT = -999999999;
107 // this is the matching component to a whole number
108 const stringsize_t Numerics::MAX_STRINGSIZE = MAX_WHOLENUMBER;
109  // max numeric digits value for explicit 64-bit conversions
110 const size_t Numerics::DIGITS64 = ((size_t)20);
111 // numeric digits 9 is always the default
112 const size_t Numerics::DEFAULT_DIGITS = ((size_t)9);
113 const bool Numerics::FORM_SCIENTIFIC = false;
114 const bool Numerics::FORM_ENGINEERING = true;
115 
116 const size_t Numerics::DEFAULT_FUZZ = ((size_t)0); /* default numeric fuzz setting */
117  /* default numeric form setting */
119 
122 
123 
125 {
129 }
130 
131 
141 {
142  // in the range for an integer object?
143  if (v <= MAX_WHOLENUMBER && v >= MIN_WHOLENUMBER)
144  {
145  return new_integer((wholenumber_t)v);
146  }
147  // out of range, we need to use a numberstring for this, using the full
148  // allowable digits range
149  return new_numberstringFromInt64(v);
150 }
151 
152 
162 {
163  // in the range for an integer object?
164  if (v <= (uint64_t)MAX_WHOLENUMBER)
165  {
166  return new_integer((stringsize_t)v);
167  }
168  // out of range, we need to use a numberstring for this, using the full
169  // allowable digits range
170  return new_numberstringFromUint64(v);
171 }
172 
173 
183 {
184  // in the range for an integer object?
185  if (v <= MAX_WHOLENUMBER && v >= MIN_WHOLENUMBER)
186  {
187  return new_integer((wholenumber_t)v);
188  }
189  // out of range, we need to use a numberstring for this, using the full
190  // allowable digits range
192 }
193 
194 
204 {
205  // in the range for an integer object?
206  if (v <= (stringsize_t)MAX_WHOLENUMBER)
207  {
208  return new_integer((stringsize_t)v);
209  }
210  // out of range, we need to use a numberstring for this, using the full
211  // allowable digits range
213 }
214 
227 {
228  // is this an integer value (very common)
229  if (isInteger(source))
230  {
231  result = ((RexxInteger *)source)->wholeNumber();
232  return result <= maxValue && result >= minValue ? true : false;
233  }
234  else
235  {
236  // get this as a numberstring (which it might already be)
237  RexxNumberString *nString = source->numberString();
238  // not convertible to number string? get out now
239  if (nString == OREF_NULL)
240  {
241  return false;
242  }
243  int64_t temp;
244 
245  // if not valid or outside of the minimum range, reject this too
246  if (nString->int64Value(&temp, ARGUMENT_DIGITS))
247  {
248  if (temp <= maxValue && temp >= minValue)
249  {
250  result = (wholenumber_t)temp;
251  return true;
252  }
253  }
254  return false;
255  }
256 }
257 
269 bool Numerics::objectToSignedInteger(RexxObject *source, ssize_t &result, ssize_t maxValue, ssize_t minValue)
270 {
271  // is this an integer value (very common)
272  if (isInteger(source))
273  {
274  result = ((RexxInteger *)source)->wholeNumber();
275  return result <= maxValue && result >= minValue ? true : false;
276  }
277  else
278  {
279  // get this as a numberstring (which it might already be)
280  RexxNumberString *nString = source->numberString();
281  // not convertible to number string? get out now
282  if (nString == OREF_NULL)
283  {
284  return false;
285  }
286  int64_t temp;
287 
288  // if not valid or outside of the minimum range, reject this too
289  if (nString->int64Value(&temp, SIZE_DIGITS))
290  {
291  if (temp <= maxValue && temp >= minValue)
292  {
293  result = (wholenumber_t)temp;
294  return true;
295  }
296  }
297  return false;
298  }
299 }
300 
301 
313 {
314  // is this an integer value (very common)
315  if (isInteger(source))
316  {
317  // reject any signed values.
318  if (((RexxInteger *)source)->wholeNumber() < 0)
319  {
320  return false;
321  }
322 
323  result = ((RexxInteger *)source)->stringSize();
324  return result <= maxValue ? true : false;
325  }
326  else
327  {
328  // get this as a numberstring (which it might already be)
329  RexxNumberString *nString = source->numberString();
330  // not convertible to number string? get out now
331  if (nString == OREF_NULL)
332  {
333  return false;
334  }
335  uint64_t temp;
336 
337  // if not valid or outside of the minimum range, reject this too
338  if (nString->unsignedInt64Value(&temp, ARGUMENT_DIGITS))
339  {
340  if ( temp <= maxValue )
341  {
342  result = (stringsize_t)temp;
343  return true;
344  }
345  }
346  return false;
347  }
348 }
349 
350 
361 bool Numerics::objectToUnsignedInteger(RexxObject *source, size_t &result, size_t maxValue)
362 {
363  // is this an integer value (very common)
364  if (isInteger(source))
365  {
366  // reject any signed values.
367  if (((RexxInteger *)source)->wholeNumber() < 0)
368  {
369  return false;
370  }
371 
372  result = ((RexxInteger *)source)->stringSize();
373  return result <= maxValue ? true : false;
374  }
375  else
376  {
377  // get this as a numberstring (which it might already be)
378  RexxNumberString *nString = source->numberString();
379  // not convertible to number string? get out now
380  if (nString == OREF_NULL)
381  {
382  return false;
383  }
384  uint64_t temp;
385 
386  // if not valid or outside of the minimum range, reject this too
387  if (nString->unsignedInt64Value(&temp, SIZE_DIGITS))
388  {
389  if ( temp <= maxValue )
390  {
391  result = (stringsize_t)temp;
392  return true;
393  }
394  }
395  return false;
396  }
397 }
398 
399 
409 bool Numerics::objectToInt64(RexxObject *source, int64_t &result)
410 /******************************************************************************/
411 /* Function: Convert a Rexx object into a numeric value within the specified */
412 /* value range. If the value is not convertable to an integer value or is */
413 /* outside of the specified range, false is returned. */
414 /******************************************************************************/
415 {
416  // is this an integer value (very common)
417  if (isInteger(source))
418  {
419  result = ((RexxInteger *)source)->wholeNumber();
420  return true;
421  }
422  else
423  {
424  // get this as a numberstring (which it might already be)
425  RexxNumberString *nString = source->numberString();
426  // not convertible to number string? get out now
427  if (nString == OREF_NULL)
428  {
429  return false;
430  }
431 
432  // if not a valid whole number, reject this too
433  return nString->int64Value(&result, DIGITS64);
434  }
435 }
436 
437 
448 {
449  // is this an integer value (very common)
450  if (isInteger(source))
451  {
452  return source;
453  }
454  else
455  {
456  // get this as a numberstring (which it might already be)
457  RexxNumberString *nString = source->numberString();
458  // not convertible to number string? get out now
459  if (nString == OREF_NULL)
460  {
461  return OREF_NULL;
462  }
463 
464  int64_t result;
465  // if not a valid whole number, reject this too
466  if (!nString->int64Value(&result, DIGITS64)) {
467  return OREF_NULL;
468  }
469  return nString;
470  }
471 }
472 
473 
483 bool Numerics::objectToUnsignedInt64(RexxObject *source, uint64_t &result)
484 /******************************************************************************/
485 /* Function: Convert a Rexx object into a numeric value within the specified */
486 /* value range. If the value is not convertable to an integer value or is */
487 /* outside of the specified range, false is returned. */
488 /******************************************************************************/
489 {
490  // is this an integer value (very common)
491  if (isInteger(source))
492  {
493  // reject any signed values.
494  if (((RexxInteger *)source)->wholeNumber() < 0)
495  {
496  return false;
497  }
498  result = ((RexxInteger *)source)->stringSize();
499  return true;
500  }
501  else
502  {
503  // get this as a numberstring (which it might already be)
504  RexxNumberString *nString = source->numberString();
505  // not convertible to number string? get out now
506  if (nString == OREF_NULL)
507  {
508  return false;
509  }
510 
511  // if not a valid whole number, reject this too
512  return nString->unsignedInt64Value(&result, DIGITS64);
513  }
514 }
515 
516 
526 bool Numerics::objectToUintptr(RexxObject *source, uintptr_t &result)
527 {
528  stringsize_t temp;
529  // if it didn't convert for the range, give a failure back
530  if (!Numerics::objectToUnsignedInteger(source, temp, UINTPTR_MAX))
531  {
532  return false;
533  }
534  // ok, this worked
535  result = (uintptr_t)temp;
536  return true;
537 }
538 
539 
549 bool Numerics::objectToIntptr(RexxObject *source, intptr_t &result)
550 {
551  wholenumber_t temp;
552  // if it didn't convert for the range, give a failure back
553  if (!Numerics::objectToSignedInteger(source, temp, INTPTR_MAX, INTPTR_MIN))
554  {
555  return false;
556  }
557  // ok, this worked
558  result = (intptr_t)temp;
559  return true;
560 }
561 
562 
573 {
574  // zero? this is pretty easy
575  if (integer == 0)
576  {
577  strcpy(dest, "0");
578  return 1;
579  }
580 
581  size_t sign = 0;
582  // we convert this directly because portable numeric-to-ascii routines
583  // don't really exist for the various 32/64 bit values.
584  char buffer[24];
585  size_t index = sizeof(buffer);
586 
587  // negative number? copy a negative sign, and take the abs value
588  if (integer < 0)
589  {
590  *dest++ = '-';
591  // work from an unsigned version that can hold all of the digits
592  // we need to use a version we can negate first, then add the
593  // digit back in
594  size_t working = (size_t)(-(integer + 1));
595  working++; // undoes the +1 above
596  sign = 1; // added in to the length
597 
598  while (working > 0)
599  {
600  // get the digit and reduce the size of the integer
601  int digit = (int)(working % 10);
602  working = working / 10;
603  // store the digit
604  buffer[--index] = digit + '0';
605  }
606  }
607  else
608  {
609  while (integer > 0)
610  {
611  // get the digit and reduce the size of the integer
612  int digit = (int)(integer % 10) + '0';
613  integer = integer / 10;
614  // store the digit
615  buffer[--index] = digit;
616  }
617  }
618 
619  // copy into the buffer and set the length
620  stringsize_t length = sizeof(buffer) - index;
621  memcpy(dest, &buffer[index], length);
622  // make sure we have a terminating null
623  dest[length] = '\0';
624  return length + sign;
625 }
626 
627 
638 {
639  // zero? this is pretty easy
640  if (integer == 0)
641  {
642  *dest = '\0';
643  return 1;
644  }
645 
646  // we convert this directly because portable numeric-to-ascii routines
647  // don't really exist for the various 32/64 bit values.
648  char buffer[24];
649  size_t index = sizeof(buffer);
650 
651  // negative number? copy a negative sign, and take the abs value
652  if (integer < 0)
653  {
654  // work from an unsigned version that can hold all of the digits
655  // we need to use a version we can negate first, then add the
656  // digit back in
657  size_t working = (size_t)(-(integer + 1));
658  working++; // undoes the +1 above
659 
660  while (working > 0)
661  {
662  // get the digit and reduce the size of the integer
663  int digit = (int)(working % 10);
664  working = working / 10;
665  // store the digit
666  buffer[--index] = digit;
667  }
668  }
669  else
670  {
671  while (integer > 0)
672  {
673  // get the digit and reduce the size of the integer
674  int digit = (int)(integer % 10);
675  integer = integer / 10;
676  // store the digit
677  buffer[--index] = digit;
678  }
679  }
680 
681  // copy into the buffer and set the length
682  stringsize_t length = sizeof(buffer) - index;
683  memcpy(dest, &buffer[index], length);
684  // make sure we have a terminating null
685  dest[length] = '\0';
686  return length;
687 }
688 
699 {
700  // zero? this is pretty easy
701  if (integer == 0)
702  {
703  strcpy((char *)dest, "0");
704  return 1;
705  }
706 
707  // we convert this directly because portable numeric-to-ascii routines
708  // don't really exist for the various 32/64 bit values.
709  char buffer[24];
710  size_t index = sizeof(buffer);
711 
712  while (integer > 0)
713  {
714  // get the digit and reduce the size of the integer
715  int digit = (int)(integer % 10) + '0';
716  integer = integer / 10;
717  // store the digit
718  buffer[--index] = digit;
719  }
720 
721  // copy into the buffer and set the length
722  stringsize_t length = sizeof(buffer) - index;
723  memcpy(dest, &buffer[index], length);
724  // make sure we have a terminating null
725  dest[length] = '\0';
726  return length;
727 }
728 
729 
739 stringsize_t Numerics::formatInt64(int64_t integer, char *dest)
740 {
741  // zero? this is pretty easy
742  if (integer == 0)
743  {
744  strcpy((char *)dest, "0");
745  return 1;
746  }
747 
748  // we convert this directly because portable numeric-to-ascii routines
749  // don't really exist for the various 32/64 bit values.
750  char buffer[32];
751  size_t index = sizeof(buffer);
752  size_t sign = 0;
753 
754  // negative number? copy a negative sign, and take the abs value
755  if (integer < 0)
756  {
757  *dest++ = '-';
758  // work from an unsigned version that can hold all of the digits
759  // we need to use a version we can negate first, then add the
760  // digit back in
761  uint64_t working = (uint64_t)(-(integer + 1));
762  working++; // undoes the +1 above
763  sign = 1; // added in to the length
764 
765  while (working > 0)
766  {
767  // get the digit and reduce the size of the integer
768  int digit = (int)(working % 10);
769  working = working / 10;
770  // store the digit
771  buffer[--index] = digit + '0';
772  }
773  }
774  else
775  {
776  while (integer > 0)
777  {
778  // get the digit and reduce the size of the integer
779  int digit = (int)(integer % 10) + '0';
780  integer = integer / 10;
781  // store the digit
782  buffer[--index] = digit;
783  }
784  }
785 
786  // copy into the buffer and set the length
787  stringsize_t length = sizeof(buffer) - index;
788  memcpy(dest, &buffer[index], length);
789  // make sure we have a terminating null
790  dest[length] = '\0';
791  return length + sign;
792 }
793 
794 
804 stringsize_t Numerics::formatUnsignedInt64(uint64_t integer, char *dest)
805 {
806  // zero? this is pretty easy
807  if (integer == 0)
808  {
809  strcpy(dest, "0");
810  return 1;
811  }
812 
813  // we convert this directly because portable numeric-to-ascii routines
814  // don't really exist for the various 32/64 bit values.
815  char buffer[32];
816  size_t index = sizeof(buffer);
817 
818  while (integer > 0)
819  {
820  // get the digit and reduce the size of the integer
821  int digit = (int)(integer % 10) + '0';
822  integer = integer / 10;
823  // store the digit
824  buffer[--index] = digit;
825  }
826 
827  // copy into the buffer and set the length
828  stringsize_t length = sizeof(buffer) - index;
829  memcpy(dest, &buffer[index], length);
830  // make sure we have a terminating null
831  dest[length] = '\0';
832  return length;
833 }
834 
835 
845 {
846  // in the range for an integer object?
847  if (v <= (uintptr_t)MAX_WHOLENUMBER)
848  {
849  return new_integer((wholenumber_t)v);
850  }
851  // out of range, we need to use a numberstring for this, using the full
852  // allowable digits range. Note that this assumes we maintain the connection
853  // that a wholenumber_t is the same size as an intptr_t.
855 }
856 
857 
867 {
868  // in the range for an integer object?
869  if (v <= (intptr_t)MAX_WHOLENUMBER && v >=(intptr_t)MIN_WHOLENUMBER)
870  {
871  return new_integer((wholenumber_t)v);
872  }
873  // out of range, we need to use a numberstring for this, using the full
874  // allowable digits range. Note that this assumes we maintain the connection
875  // that a wholenumber_t is the same size as an intptr_t.
877 }
878 
879 
889 {
890  // some platforms render a null pointer as "0x(nil)". We want this
891  // to be just zero, so force it that way
892  if (p == 0)
893  {
894  return new_string("0x0");
895  }
896 
897  // format this into a chracter string
898  char temp[32];
899  // unfortunately, the formation of %p is not consistent across platforms.
900  // We first format this directly, and if the value does not be
901  sprintf(temp, "%p", p);
902  if (temp[1] != 'x')
903  {
904  sprintf(temp, "0x%p", p);
905  }
906  return new_string(temp);
907 
908 }
Numerics::objectToInt64
static bool objectToInt64(RexxObject *o, int64_t &result)
Definition: Numerics.cpp:409
Numerics::int64Object
static RexxObject * int64Object(RexxObject *source)
Definition: Numerics.cpp:447
Numerics::objectToStringSize
static bool objectToStringSize(RexxObject *o, stringsize_t &result, stringsize_t max)
Definition: Numerics.cpp:312
Numerics::defaultSettings
static NumericSettings defaultSettings
Definition: Numerics.hpp:143
Numerics::formatStringSize
static size_t formatStringSize(stringsize_t integer, char *dest)
Definition: Numerics.cpp:698
NumericSettings
Definition: Numerics.hpp:49
new_numberstringFromWholenumber
RexxNumberString * new_numberstringFromWholenumber(wholenumber_t n)
Definition: NumberStringClass.hpp:279
new_integer
RexxInteger * new_integer(wholenumber_t v)
Definition: IntegerClass.hpp:198
RexxNumberString::unsignedInt64Value
bool unsignedInt64Value(uint64_t *result, stringsize_t numDigits)
Definition: NumberStringClass.cpp:1033
Numerics::formatWholeNumber
static size_t formatWholeNumber(wholenumber_t integer, char *dest)
Definition: Numerics.cpp:572
IntegerClass.hpp
Numerics::objectToSignedInteger
static bool objectToSignedInteger(RexxObject *o, ssize_t &result, ssize_t max, ssize_t min)
Definition: Numerics.cpp:269
new_numberstringFromStringsize
RexxNumberString * new_numberstringFromStringsize(stringsize_t n)
Definition: NumberStringClass.hpp:284
RexxNumberString::int64Value
bool int64Value(int64_t *result, stringsize_t numDigits)
Definition: NumberStringClass.cpp:933
Numerics::validMaxWhole
static const wholenumber_t validMaxWhole[]
Definition: Numerics.hpp:83
Numerics::MIN_EXPONENT
static const wholenumber_t MIN_EXPONENT
Definition: Numerics.hpp:65
Numerics.hpp
Numerics::int64ToObject
static RexxObject * int64ToObject(int64_t v)
Definition: Numerics.cpp:140
Numerics::MAX_STRINGSIZE
static const size_t MAX_STRINGSIZE
Definition: Numerics.hpp:72
Numerics::wholenumberToObject
static RexxObject * wholenumberToObject(wholenumber_t v)
Definition: Numerics.cpp:182
Numerics::MAX_WHOLENUMBER
static const wholenumber_t MAX_WHOLENUMBER
Definition: Numerics.hpp:62
Numerics::objectToUnsignedInteger
static bool objectToUnsignedInteger(RexxObject *o, size_t &result, size_t max)
Definition: Numerics.cpp:361
Numerics::FORM_SCIENTIFIC
static const bool FORM_SCIENTIFIC
Definition: Numerics.hpp:76
Numerics::uintptrToObject
static RexxObject * uintptrToObject(uintptr_t v)
Definition: Numerics.cpp:844
Numerics::DIGITS64
static const size_t DIGITS64
Definition: Numerics.hpp:75
Numerics::SIZE_DIGITS
static const size_t SIZE_DIGITS
Definition: Numerics.hpp:71
NumericSettings::NumericSettings
NumericSettings()
Definition: Numerics.cpp:124
Numerics::objectToUintptr
static bool objectToUintptr(RexxObject *source, uintptr_t &result)
Definition: Numerics.cpp:526
Numerics::pointerToString
static RexxString * pointerToString(void *)
Definition: Numerics.cpp:888
new_numberstringFromInt64
RexxNumberString * new_numberstringFromInt64(int64_t n)
Definition: NumberStringClass.hpp:289
Numerics::uint64ToObject
static RexxObject * uint64ToObject(uint64_t v)
Definition: Numerics.cpp:161
Numerics::ARGUMENT_DIGITS
static const size_t ARGUMENT_DIGITS
Definition: Numerics.hpp:68
Numerics::formatUnsignedInt64
static size_t formatUnsignedInt64(uint64_t integer, char *dest)
Definition: Numerics.cpp:804
Numerics::objectToWholeNumber
static bool objectToWholeNumber(RexxObject *o, wholenumber_t &result, wholenumber_t max, wholenumber_t min)
Definition: Numerics.cpp:226
new_string
RexxString * new_string(const char *s, stringsize_t l)
Definition: StringClass.hpp:524
__INT64_C
#define __INT64_C(c)
Definition: rexxplatformdefs.h:50
OREF_NULL
#define OREF_NULL
Definition: RexxCore.h:60
Numerics::DEFAULT_FORM
static const bool DEFAULT_FORM
Definition: Numerics.hpp:81
NumberStringClass.hpp
isInteger
bool isInteger(RexxObject *o)
Definition: RexxCore.h:265
Numerics::formatInt64
static size_t formatInt64(int64_t integer, char *dest)
Definition: Numerics.cpp:739
Numerics::stringsizeToObject
static RexxObject * stringsizeToObject(stringsize_t v)
Definition: Numerics.cpp:203
Numerics::DEFAULT_DIGITS
static const size_t DEFAULT_DIGITS
Definition: Numerics.hpp:66
Numerics::FORM_ENGINEERING
static const bool FORM_ENGINEERING
Definition: Numerics.hpp:77
NumericSettings::digits
size_t digits
Definition: Numerics.hpp:53
Numerics::intptrToObject
static RexxObject * intptrToObject(intptr_t v)
Definition: Numerics.cpp:866
RexxNumberString
Definition: NumberStringClass.hpp:93
wholenumber_t
ssize_t wholenumber_t
Definition: rexx.h:229
Numerics::normalizeWholeNumber
static size_t normalizeWholeNumber(wholenumber_t integer, char *dest)
Definition: Numerics.cpp:637
stringsize_t
size_t stringsize_t
Definition: rexx.h:228
NumericSettings::form
bool form
Definition: Numerics.hpp:55
Numerics::DEFAULT_FUZZ
static const size_t DEFAULT_FUZZ
Definition: Numerics.hpp:79
Numerics::objectToUnsignedInt64
static bool objectToUnsignedInt64(RexxObject *o, uint64_t &result)
Definition: Numerics.cpp:483
new_numberstringFromUint64
RexxNumberString * new_numberstringFromUint64(uint64_t n)
Definition: NumberStringClass.hpp:294
RexxObject::numberString
RexxNumberString * numberString()
Definition: ObjectClass.cpp:1018
RexxCore.h
Numerics::MIN_WHOLENUMBER
static const wholenumber_t MIN_WHOLENUMBER
Definition: Numerics.hpp:63
Numerics::settings
static NumericSettings * settings
Definition: Numerics.hpp:142
Numerics::MAX_EXPONENT
static const wholenumber_t MAX_EXPONENT
Definition: Numerics.hpp:64
RexxInteger
Definition: IntegerClass.hpp:56
Numerics::objectToIntptr
static bool objectToIntptr(RexxObject *source, intptr_t &result)
Definition: Numerics.cpp:549
NumericSettings::fuzz
size_t fuzz
Definition: Numerics.hpp:54
RexxObject
Definition: ObjectClass.hpp:311
RexxString
Definition: StringClass.hpp:119