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)  

IntegerClass.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.oorexx.org/license.html */
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 IntegerClass.c */
40 /* */
41 /* Primitive Integer Class */
42 /* */
43 /******************************************************************************/
44 #include <ctype.h>
45 #include <string.h>
46 #include <stdlib.h>
47 #include <math.h>
48 #include "RexxCore.h"
49 #include "StringClass.hpp"
50 #include "ArrayClass.hpp"
51 #include "RexxActivation.hpp"
52 #include "RexxActivity.hpp"
53 #include "Numerics.hpp"
54 #include "RexxCompoundTail.hpp"
55 
56 
57 
58 // singleton class instance
60 
64 
76  /* define an operator forwarding */
77  /* method */
78 
79 #define string_forwarder_cpp(method)\
80 RexxObject *RexxInteger::##method(RexxObject *operand)\
81  {\
82  return (RexxObject *)this->string()->method(operand);\
83  }
84 
85 
92 {
93  return stringValue()->getHashValue();
94 }
95 
96 
97 void RexxInteger::live(size_t liveMark)
98 /******************************************************************************/
99 /* Function: Normal garbage collection live marking */
100 /******************************************************************************/
101 {
102  memory_mark(this->objectVariables);
103  memory_mark(this->stringrep);
104 }
105 
106 void RexxInteger::liveGeneral(int reason)
107 /******************************************************************************/
108 /* Function: Generalized object marking */
109 /******************************************************************************/
110 {
111  memory_mark_general(this->objectVariables);
113 }
114 
116 /******************************************************************************/
117 /* Function: Flatten an object */
118 /******************************************************************************/
119 {
121 
122  flatten_reference(newThis->objectVariables, envelope);
123  flatten_reference(newThis->stringrep, envelope);
124 
126 }
127 
129 /******************************************************************************/
130 /* Function: Handle a REQUEST('STRING') request for a REXX integer object */
131 /******************************************************************************/
132 {
133  return this->stringValue(); /* return the string value */
134 }
135 
136 
143 {
144  return this->stringValue()->makeArray(); // have the string value handle this
145 }
146 
148 /******************************************************************************/
149 /* Function: Handle a HASMETHOD request for an integer */
150 /******************************************************************************/
151 {
152  /* return the string value's answer */
153  return this->stringValue()->hasMethod(methodName);
154 }
155 
157 /******************************************************************************/
158 /* Function: Handle a REQUEST('STRING') request for a REXX integer object */
159 /******************************************************************************/
160 {
161  if (this->stringrep != OREF_NULL) /* have a string already? */
162  {
163  return this->stringrep; /* return it directly */
164  }
165  char stringBuffer[32]; /* integer formatting buffer */
166  /* convert value into string */
167  Numerics::formatWholeNumber(this->value, stringBuffer);
168 
169  /* return as a string */
170  RexxString *string = new_string(stringBuffer, strlen(stringBuffer));
171  /* cache this away for later */
172  OrefSet(this, this->stringrep, string);
173  this->setHasReferences(); // now have references that need marking
174  return string; /* return the new string */
175 }
176 
178 /******************************************************************************/
179 /* Function: Return the string value for an integer */
180 /******************************************************************************/
181 {
182  if (this->stringrep != OREF_NULL) /* have a string already? */
183  {
184  return this->stringrep; /* return it directly */
185  }
186 
187  char stringBuffer[32]; /* integer formatting buffer */
188  /* convert value into string */
189  Numerics::formatWholeNumber(this->value, stringBuffer);
190  /* return as a string */
191  RexxString *string = new_string(stringBuffer, strlen(stringBuffer));
192  /* cache this away for later */
193  OrefSet(this, this->stringrep, string);
194  this->setHasReferences(); /* we now have references */
195  return string; /* return the new string */
196 }
197 
199 /******************************************************************************/
200 /* Function: Copy the value of an integer into a compound variable name */
201 /******************************************************************************/
202 {
203  if (this->stringrep != OREF_NULL) /* have a string already? */
204  {
205  /* copying directly from an existing string rep is faster */
206  /* than formatting a new value and copying. */
208  return;
209  }
210  char stringBuffer[32]; /* integer formatting buffer */
211  /* convert value into string */
212  Numerics::formatWholeNumber(this->value, stringBuffer);
213  /* append this to the buffer */
214  tail->append(stringBuffer, strlen(stringBuffer));
215 }
216 
217 
219 /******************************************************************************/
220 /* Function: Convert an integer into a numberstring value */
221 /******************************************************************************/
222 {
223  if (this->stringrep != OREF_NULL) /* have a cached string value? */
224  {
225  /* use its numberstring value */
226  return this->stringrep->numberString();
227  }
228  else /* create a new numberstring */
229  {
231  }
232 }
233 
234 
243 bool RexxInteger::doubleValue(double &result)
244 {
245  // just let the compiler convert
246  result = (double)this->wholeNumber();
247  return true;
248 }
249 
250 
261 {
262  /* is the long value expressable as a*/
263  /* whole number in REXX term. */
265  {
266  return false; /* nope, not a valid long. */
267  }
268  result = value; // return the value
269  return true; // this was convertable
270 }
271 
272 
283 bool RexxInteger::numberValue(wholenumber_t &result, size_t digits)
284 {
285  /* is the long value expressable as a*/
286  /* whole number in REXX term. */
288  {
289  return false; /* nope, not a valid long. */
290  }
291  result = value; // return the value
292  return true; // this was convertable
293 }
294 
295 
306 {
307  // this must be non-negative and not out of range
308  if (value < 0 || value > Numerics::MAX_WHOLENUMBER)
309  {
310  return false;
311  }
312  result = wholeNumber(); // return the value
313  return true; // this was convertable
314 }
315 
316 
327 bool RexxInteger::unsignedNumberValue(stringsize_t &result, size_t digits)
328 {
329  /* is the long value expressable as a*/
330  /* whole number in REXX term. */
331  if (value < 0 || (digits < Numerics::DEFAULT_DIGITS && value >= Numerics::validMaxWhole[digits - 1]))
332  {
333  return false; /* nope, not a valid long. */
334  }
335  result = wholeNumber(); // return the value
336  return true; // this was convertable
337 }
338 
340  size_t digits) /* required precision (ignored) */
341 /******************************************************************************/
342 /* Function: Convert an integer to an integer (real easy!) */
343 /******************************************************************************/
344 {
345  return this; /* just return directly */
346 }
347 
349  RexxString *string ) /* new string value */
350 /******************************************************************************/
351 /* Function: Add a string value to the string look-a-side. */
352 /******************************************************************************/
353 {
354  /* set the strign */
355  OrefSet(this, this->stringrep, string);
356  this->setHasReferences(); /* we now have references */
357 }
358 
360  int errorcode ) /* error to raise if not good */
361 /******************************************************************************/
362 /* Function: Determine the truth value of an integer object */
363 /******************************************************************************/
364 {
365  if (this->value == 0) /* have a zero? */
366  {
367  return false; /* this is false */
368  }
369  else if (this->value != 1) /* how about a one? */
370  {
371  reportException(errorcode, this);/* report the error */
372  }
373  return true; /* this is true */
374 }
375 
376 
386 {
387  if (this->value == 0) /* have a zero? */
388  {
389  result = false; // this is false and the conversion worked
390  return true;
391  }
392  else if (this->value == 1) /* how about a one? */
393  {
394  result = true; // this is true and the conversion worked
395  return true;
396  }
397  else
398  {
399  return false; // bad conversion
400  }
401 }
402 
403 /******************************************************************************/
404 /* Function: Macro to forward a method against the numberstring value of */
405 /* an integer object. */
406 /******************************************************************************/
407 
408 #define integer_forward(s,m,o) ((s)->numberString()->m(o))
409 
411  RexxString *msgname, /* unknown message name */
412  RexxArray *arguments) /* arguments to the unknown message */
413 /******************************************************************************/
414 /* Function: Intercept unknown messages to an integer object and reissue */
415 /* them against the string value. */
416 /******************************************************************************/
417 {
418  /* just reissue this */
419  return this->stringValue()->sendMessage(msgname, arguments);
420 }
421 
422 
432 {
433  return stringValue()->isInstanceOf(other);
434 }
435 
436 
446 {
447  return stringValue()->instanceMethod(method_name);
448 }
449 
450 
463 {
464  return stringValue()->instanceMethods(class_object);
465 }
466 
467 
469  RexxString *other ) /* other object for concatenation */
470 /******************************************************************************/
471 /* Function: Concatenate an object to an integer */
472 /******************************************************************************/
473 {
474  requiredArgument(other, ARG_ONE); /* this is required */
475  other = REQUEST_STRING(other); /* ensure a string value */
476  /* do the concatenate */
477  return this->stringValue()->concatWith(other, ' ');
478 }
479 
481  RexxString *other ) /* other object for concatenation */
482 /******************************************************************************/
483 /* Function: Concatenate an object to an integer */
484 /******************************************************************************/
485 {
486  requiredArgument(other, ARG_ONE); /* this is required */
487  other = REQUEST_STRING(other); /* ensure a string value */
488  /* do the concatenate */
489  return this->stringValue()->concat(other);
490 }
491 
493  RexxInteger *other) /* target other object */
494 /******************************************************************************/
495 /* Function: Add an integer to another object */
496 /******************************************************************************/
497 {
498  /* are we using default digits? */
500  /* nope, we can't do integer arith */
501  return integer_forward(this, plus, other);
502  if (other == OREF_NULL) /* unary */
503  return this; /* just return ourselves */
504  else { /* binary */
505  if (isOfClass(Integer, other)) { /* adding two integers together? */
506  /* add the numbers */
507  wholenumber_t tempVal = this->value + other->value;
508  /* result still within range? */
509  if (tempVal <= Numerics::MAX_WHOLENUMBER && tempVal >= Numerics::MIN_WHOLENUMBER)
510  return new_integer(tempVal); /* return as an integer number */
511  }
512  /* need to do full arithmetic */
513  return integer_forward(this, plus, other);
514  }
515 }
516 
518  RexxInteger *other) /* target other object */
519 /******************************************************************************/
520 /* Function: Subtract another object from an integer */
521 /******************************************************************************/
522 {
523  /* are we using default digits? */
525  /* nope, then we can do integer arith*/
526  return integer_forward(this, minus, other);
527 
528  if (other == OREF_NULL) { /* unary subtraction operator */
529  return new_integer(-this->value); /* and return a new integer */
530  }
531  else { /* binary subtraction operation */
532  if (isOfClass(Integer, other)) { /* subtracting two integers? */
533  /* subtract the numbers */
534  wholenumber_t tempVal = this->value - other->value;
535  /* result still within range? */
536  if (tempVal <= Numerics::MAX_WHOLENUMBER && tempVal >= Numerics::MIN_WHOLENUMBER)
537  return new_integer(tempVal); /* return as an integer number */
538  }
539  /* need to do full arithmetic */
540  return integer_forward(this, minus, other);
541  }
542 }
543 
545  RexxInteger *other) /* target other object */
546 /******************************************************************************/
547 /* Function: Multiply an integer by another object */
548 /******************************************************************************/
549 {
550  /* are we using default digits? */
552  /* nope, we can't do integer math */
553  return integer_forward(this, multiply, other);
554  requiredArgument(other, ARG_ONE); /* make sure the argument is there */
555  /* is the other an integer and will */
556  /* the result be in a good range? */
557  if (isOfClass(Integer, other) && Numerics::abs(this->value) <= 99999 && Numerics::abs(other->value) <= 9999)
558  {
559  /* multiply directly */
560  return new_integer(this->value * other->value);
561  }
562  else /* do the slow way */
563  return integer_forward(this, multiply, other);
564 }
565 
567  RexxInteger *other) /* target other object */
568 /******************************************************************************/
569 /* Function: Perform division (actually done as numberstring math) */
570 /******************************************************************************/
571 {
572  /* just forward this */
573  return integer_forward(this, divide, other);
574 }
575 
577  RexxInteger *other) /* target other object */
578 /******************************************************************************/
579 /* Function: Perform integer division */
580 /******************************************************************************/
581 {
582  /* are we using default digits? */
584  /* nope, we can't do integer arith */
585  return integer_forward(this, integerDivide, other);
586  requiredArgument(other, ARG_ONE); /* make sure this is really there */
587 
588  if (isOfClass(Integer, other)) { /* is right object an integer? */
589  /* is right number 0? */
590  if (other->value != 0)
591  {
592  // do the division directly
593  return new_integer(this->value / other->value);
594  }
595  else /* yes, raise error. */
597  }
598  /* not integer, forward to */
599  /*numberstring. */
600  return integer_forward(this, integerDivide, other);
601 }
602 
604  RexxInteger *other) /* target other object */
605 /******************************************************************************/
606 /* Function: Perform remainder division */
607 /******************************************************************************/
608 {
609  /* are we using default digits? */
611  /* nope, we can't do integer arith */
612  return integer_forward(this, remainder, other);
613  requiredArgument(other, ARG_ONE); /* make sure this is really there */
614 
615  if (isOfClass(Integer, other)) { /* is right object an integer? */
616  /* is right number 0? */
617  if (other->value != 0)
618  {
619  // we can do this directly
620  return new_integer(this->value % other->value);
621  }
622  else /* yes, raise error. */
624  }
625  /* not integer, forward to */
626  /*numberstring. */
627  return integer_forward(this, remainder, other);
628 }
629 
631  RexxObject *other) /* power exponent value */
632 /******************************************************************************/
633 /* Function: Process integer power operator (actually just a forwarder) */
634 /******************************************************************************/
635 {
636  /* just send along */
637  return integer_forward(this, power, other);
638 }
639 
641  RexxObject *other) /* other comparison object */
642 /******************************************************************************/
643 /* Function: Primitive strict equal\not equal method. This determines */
644 /* only strict equality, not greater or less than values. */
645 /******************************************************************************/
646 {
647  if (this->isSubClassOrEnhanced()) /* not a primitive? */
648  {
649  /* do the full lookup compare */
650  return this->sendMessage(OREF_STRICT_EQUAL, other)->truthValue(Error_Logical_value_method);
651  }
652 
653  if (isOfClass(Integer, other)) /* two integers? */
654  /* just directly compare the values */
655  return this->value == ((RexxInteger *)other)->value;
656  /* go do a string compare */
657  return this->stringValue()->isEqual(other);
658 }
659 
661  RexxObject *other) /* other comparison value */
662 /******************************************************************************/
663 /* Function: Compare the two values. */
664 /* */
665 /* Returned: return <0 if other is greater than this */
666 /* return 0 if this equals other */
667 /* return >0 if this is greater than other */
668 /******************************************************************************/
669 {
670  requiredArgument(other, ARG_ONE); /* make sure this is really there */
671  if (isOfClass(Integer, other)) /* string compare is simple */
672  /* just return their difference */
673  return this->value - ((RexxInteger *)other)->value;
674  else /* go do a string compare */
675  return this->stringValue()->strictComp((RexxString *)other);
676 }
677 
678 
689 {
690  requiredArgument(other, ARG_ONE); /* make sure this is really there */
691  /* able to compare here? */
692  if (this->isSameType(other) && number_digits() == Numerics::DEFAULT_DIGITS)
693  {
694  /* just return the difference */
695  return this->value - ((RexxInteger *)other)->value;
696  }
697  else /* do a numberstring compare */
698  {
699  return this->numberString()->comp(other);
700  }
701 }
702 
703 
711 {
712  // get the hash value, which is actually derived from the integer string value
713  HashCode hashVal = this->hash();
714  return new_string((char *)&hashVal, sizeof(HashCode));
715 }
716 
717 
719  RexxObject *other) /* other comparison value */
720 /******************************************************************************/
721 /* Function: Perform the primitive level "==" compare, including the hash */
722 /* value processing. */
723 /******************************************************************************/
724 {
725  if (other == TheNilObject) // all conditionals return .false when compared to .nil
726  {
727  return TheFalseObject;
728  }
729  return this->strictComp(other) == 0 ? TheTrueObject : TheFalseObject;
730 }
731 
732 
734  RexxObject *other) /* other comparison value */
735 /******************************************************************************/
736 /* Function: Strict inequality operation */
737 /******************************************************************************/
738 {
739  if (other == TheNilObject) // all conditionals return .false when compared to .nil
740  {
741  return TheTrueObject;
742  }
743  /* return strict compare result */
744  return (this->strictComp(other) != 0) ? TheTrueObject : TheFalseObject;
745 }
746 
748  RexxObject *other) /* other comparison value */
749 /******************************************************************************/
750 /* Function: non-strict "=" operator */
751 /******************************************************************************/
752 {
753  if (other == TheNilObject) // all conditionals return .false when compared to .nil
754  {
755  return TheFalseObject;
756  }
757  return this->comp(other) == 0 ? TheTrueObject : TheFalseObject;
758 }
759 
761  RexxObject *other) /* other comparison value */
762 /******************************************************************************/
763 /* Function: non-strict "\=" operator */
764 /******************************************************************************/
765 {
766  if (other == TheNilObject) // all conditionals return .false when compared to .nil
767  {
768  return TheTrueObject;
769  }
770  return this->comp(other) != 0 ? TheTrueObject : TheFalseObject;
771 }
772 
774  RexxObject *other) /* other comparison value */
775 /******************************************************************************/
776 /* Function: non-strict ">" operator */
777 /******************************************************************************/
778 {
779  if (other == TheNilObject) // all conditionals return .false when compared to .nil
780  {
781  return TheFalseObject;
782  }
783  return this->comp(other) > 0 ? TheTrueObject : TheFalseObject;
784 }
785 
787  RexxObject *other) /* other comparison value */
788 /******************************************************************************/
789 /* Function: non-strict "<" operator */
790 /******************************************************************************/
791 {
792  if (other == TheNilObject) // all conditionals return .false when compared to .nil
793  {
794  return TheFalseObject;
795  }
796  return this->comp(other) < 0 ? TheTrueObject : TheFalseObject;
797 }
798 
800  RexxObject *other) /* other comparison value */
801 /******************************************************************************/
802 /* Function: non-strict ">=" operator */
803 /******************************************************************************/
804 {
805  if (other == TheNilObject) // all conditionals return .false when compared to .nil
806  {
807  return TheFalseObject;
808  }
809  return this->comp(other) >= 0 ? TheTrueObject : TheFalseObject;
810 }
811 
813  RexxObject *other) /* other comparison value */
814 /******************************************************************************/
815 /* Function: non-strict "<=" operator */
816 /******************************************************************************/
817 {
818  if (other == TheNilObject) // all conditionals return .false when compared to .nil
819  {
820  return TheFalseObject;
821  }
822  return this->comp(other) <= 0 ? TheTrueObject : TheFalseObject;
823 }
824 
825 
827  RexxObject *other) /* other comparison value */
828 /******************************************************************************/
829 /* Function: strict ">>" operator */
830 /******************************************************************************/
831 {
832  if (other == TheNilObject) // all conditionals return .false when compared to .nil
833  {
834  return TheFalseObject;
835  }
836  return this->strictComp(other) > 0 ? TheTrueObject : TheFalseObject;
837 }
838 
840  RexxObject *other) /* other comparison value */
841 /******************************************************************************/
842 /* Function: strict "<<" operator */
843 /******************************************************************************/
844 {
845  if (other == TheNilObject) // all conditionals return .false when compared to .nil
846  {
847  return TheFalseObject;
848  }
849  return this->strictComp(other) < 0 ? TheTrueObject : TheFalseObject;
850 }
851 
853  RexxObject *other) /* other comparison value */
854 /******************************************************************************/
855 /* Function: strict ">>=" operator */
856 /******************************************************************************/
857 {
858  if (other == TheNilObject) // all conditionals return .false when compared to .nil
859  {
860  return TheFalseObject;
861  }
862  return this->strictComp(other) >= 0 ? TheTrueObject : TheFalseObject;
863 }
864 
866  RexxObject *other) /* other comparison value */
867 /******************************************************************************/
868 /* Function: strict "<<=" operator */
869 /******************************************************************************/
870 {
871  if (other == TheNilObject) // all conditionals return .false when compared to .nil
872  {
873  return TheFalseObject;
874  }
875  return this->strictComp(other) <= 0 ? TheTrueObject : TheFalseObject;
876 }
877 
879 /******************************************************************************/
880 /* Function: Perform the logical not of an integer object */
881 /******************************************************************************/
882 {
883  /* perform the operation */
885 }
886 
888  RexxObject *dummy ) /* dummy for polymorphic operators */
889 /******************************************************************************/
890 /* Function: Perform the logical not of an integer object */
891 /******************************************************************************/
892 {
893  /* perform the operation */
895 }
896 
898  RexxObject *other) /* other logical value */
899 /******************************************************************************/
900 /* Function: Logically AND two objects together */
901 /******************************************************************************/
902 {
903  RexxObject *otherTruth; /* truth value of the other object */
904 
905  requiredArgument(other, ARG_ONE); /* make sure the argument is there */
906  /* validate the boolean */
908  /* perform the operation */
909  return (!this->truthValue(Error_Logical_value_method)) ? TheFalseObject : otherTruth;
910 }
911 
913  RexxObject *other) /* other logical value */
914 /******************************************************************************/
915 /* Function: Logically OR two objects together */
916 /******************************************************************************/
917 {
918  RexxObject *otherTruth; /* truth value of the other object */
919 
920  requiredArgument(other, ARG_ONE); /* make sure the argument is there */
921  /* validate the boolean */
923  /* perform the operation */
924  return (this->truthValue(Error_Logical_value_method)) ? TheTrueObject : otherTruth;
925 }
926 
928  RexxObject *other) /* other logical value */
929 /******************************************************************************/
930 /* Function: Logically XOR two objects together */
931 /******************************************************************************/
932 {
933  requiredArgument(other, ARG_ONE); /* make sure the argument is there */
934  /* get as a boolean */
935  bool truth = other->truthValue(Error_Logical_value_method);
936  /* first one false? */
938  /* value is always the second */
939  return truth ? TheTrueObject : TheFalseObject;
940  else /* value is inverse of second */
941  return (truth) ? TheFalseObject : TheTrueObject;
942 }
943 
945 /******************************************************************************/
946 /* Function: Take the absolute value of an integer object */
947 /******************************************************************************/
948 {
949  /* working under the default digits? */
951  /* if we're already positive, this is a quick return */
952  if (value >= 0) {
953  return this;
954  }
955  return new_integer(-value); /* return as an integer object */
956  }
957  else
958  return this->numberString()->abs(); /* do a numberstring operation */
959 }
960 
962 /******************************************************************************/
963 /* Function: SIGN() function on an integer object */
964 /******************************************************************************/
965 {
966  RexxObject *result; /* returned result */
967 
968  if (this->value > 0) /* positive number? */
969  result = IntegerOne; /* result is "1" */
970  else if (this->value < 0) /* negative number? */
971  result = new_integer(-1); /* result is "-1" */
972  else
973  result = IntegerZero; /* exactly zero */
974  return result; /* return the value */
975 }
976 
978  RexxObject **args, /* array of comparison values */
979  size_t argCount) /* count of arguments */
980 /******************************************************************************/
981 /* Function: Perform MAX function on integer objects */
982 /******************************************************************************/
983 {
984  wholenumber_t maxvalue; /* current maximum */
985  size_t arg; /* current arg position */
986  RexxObject * argument; /* current argument object */
987 
988 
989  /* are we using default digits? */
991  /* nope, we can't do integer max. */
992  return this->numberString()->Max(args, argCount);
993 
994  if (argCount < 1) /* no comparisons to do? */
995  return (RexxObject *)this; /* just return this as the result */
996 
997  maxvalue = this->value; /* assume first number is our max. */
998 
999  /* check each numbers to see if */
1000  /* larger than the max. */
1001  for (arg = 0; arg < argCount; arg++) {
1002  argument = args[arg]; /* get next argument element */
1003 
1004  if (argument == OREF_NULL) /* was argument missging ? */
1005  /* Yes, report the error. */
1007 
1008  if (isOfClass(Integer, argument)) { /* is this an INTEGER object? */
1009  /* yes, gets its value. */
1010  wholenumber_t v = ((RexxInteger *)argument)->getValue();
1011  if (v > maxvalue) /* is this number larger than max? */
1012  maxvalue = v; /* yes, it is our new max. */
1013  }
1014  else { /* not an integer, compare isn't */
1015  /* not all integers, convert into a */
1016  /* NumberString, and let NumberString*/
1017  /* figure this out. */
1018  return this->numberString()->Max(args, argCount);
1019  }
1020  }
1021 
1022  return new_integer(maxvalue); /* yes, then max is our max number */
1023 }
1024 
1026  RexxObject **args, /* array of comparison values */
1027  size_t argCount) /* count of arguments */
1028 /******************************************************************************/
1029 /* Function: Perform MAX function on integer objects */
1030 /******************************************************************************/
1031 {
1032  wholenumber_t minvalue; /* current minimum */
1033  size_t arg; /* current arg position */
1034  RexxObject * argument; /* current argument object */
1035 
1036  /* are we using default digits? */
1038  /* nope, we can't do integer max. */
1039  return this->numberString()->Min(args, argCount);
1040 
1041  if (argCount < 1) /* no comparisons to do? */
1042  return (RexxObject *)this; /* just return this as the result */
1043 
1044  minvalue = this->value; /* assume first number is our min. */
1045 
1046  /* check each numbers to see if */
1047  /* larger than the max. */
1048  for (arg = 0; arg < argCount; arg++) {
1049  argument = args[arg]; /* get next argument element */
1050 
1051  if (argument == OREF_NULL) /* was argument missging ? */
1052  /* Yes, report the error. */
1054 
1055  if (isOfClass(Integer, argument)) { /* is this an INTEGER object? */
1056  /* yes, gets its value. */
1057  wholenumber_t v = ((RexxInteger *)argument)->getValue();
1058  if (v < minvalue) /* is this number larger than min? */
1059  minvalue = v; /* yes, it is our new max. */
1060  }
1061  else { /* not an integer, compare isn't */
1062  /* not all integers, convert into a */
1063  /* NumberString, and let NumberString*/
1064  /* figure this out. */
1065  return this->numberString()->Min(args, argCount);
1066  }
1067  }
1068 
1069  return new_integer(minvalue); /* yes, then max is our max number */
1070 }
1071 
1073  RexxObject *decimals) /* number of decimal digits requested*/
1074 /******************************************************************************/
1075 /* Function: Act as a front end for the actual TRUNC REXX method */
1076 /******************************************************************************/
1077 {
1078  /* just forward to numberstring */
1079  return this->numberString()->trunc(decimals);
1080 }
1081 
1088 {
1089  // the floor of an integer is always the same value
1090  return this;
1091 }
1092 
1099 {
1100  // the ceiling of an integer is always the same value
1101  return this;
1102 }
1103 
1110 {
1111  // the rounding of an integer is always the same value
1112  return this;
1113 }
1114 
1116  RexxObject *Integers, /* space for integer part */
1117  RexxObject *Decimals, /* number of decimals required */
1118  RexxObject *MathExp, /* the exponent size */
1119  RexxObject *ExpTrigger ) /* the exponent trigger */
1120 /******************************************************************************/
1121 /* Function: Act as a front end for the actual FORMAT REXX method */
1122 /******************************************************************************/
1123 {
1124  return this->numberString()->formatRexx(Integers, Decimals, MathExp, ExpTrigger);
1125 }
1126 
1128  RexxObject *length) /* length of result */
1129 /******************************************************************************/
1130 /* Function: Convert a decimal number string into a character string */
1131 /******************************************************************************/
1132 {
1133  /* format as a string value */
1134  return this->numberString()->d2xD2c(length, true);
1135 }
1136 
1138  RexxObject *length) /* length of result */
1139 /******************************************************************************/
1140 /* Function: Convert a decimal number string into a hexadecimal string */
1141 /******************************************************************************/
1142 {
1143  /* format as a string value */
1144  return this->numberString()->d2xD2c(length, false);
1145 }
1146 
1148  RexxActivation *context, /* current activation context */
1149  RexxExpressionStack *stack ) /* evaluation stack */
1150 /******************************************************************************/
1151 /* Function: Polymorphic method that makes integer a polymorphic expression */
1152 /* term for literals */
1153 /******************************************************************************/
1154 {
1155  stack->push(this); /* place on the evaluation stack */
1156  /* trace if necessary */
1157  context->traceIntermediate(this, TRACE_PREFIX_LITERAL);
1158  return this; /* also return the result */
1159 }
1160 
1161 
1163  RexxActivation *context) /* current activation context */
1164 /******************************************************************************/
1165 /* Function: Polymorphic get_value function used with expression terms */
1166 /******************************************************************************/
1167 {
1168  return (RexxObject *)this; /* just return this value */
1169 }
1170 
1171 
1173  RexxVariableDictionary *context) /* current activation context */
1174 /******************************************************************************/
1175 /* Function: Polymorphic get_value function used with expression terms */
1176 /******************************************************************************/
1177 {
1178  return (RexxObject *)this; /* just return this value */
1179 }
1180 
1181 
1183  RexxActivation *context) /* current activation context */
1184 /******************************************************************************/
1185 /* Function: Polymorphic get_value function used with expression terms */
1186 /******************************************************************************/
1187 {
1188  return (RexxObject *)this; /* just return this value */
1189 }
1190 
1191 
1193  RexxVariableDictionary *context) /* current activation context */
1194 /******************************************************************************/
1195 /* Function: Polymorphic get_value function used with expression terms */
1196 /******************************************************************************/
1197 {
1198  return (RexxObject *)this; /* just return this value */
1199 }
1200 
1201 /* **************************************** */
1202 /* Integer class methods begin here ..... */
1203 /* **************************************** */
1204 
1206 /******************************************************************************/
1207 /* This method will pre-allocate 100 integer objects, 0-99. These will then */
1208 /* be used when ever a request for an integer between 0 and 99 is requested */
1209 /* this should help reduce some of our memory requirements and trips through */
1210 /* memory_new. */
1211 /******************************************************************************/
1212 {
1213  int i; /* loop counter */
1214 
1215  for (i=INTEGERCACHELOW; i<INTEGERCACHESIZE; i++ ) { /* now create all our cached integers*/
1216  OrefSet(this, this->integercache[i - INTEGERCACHELOW], new RexxInteger (i));
1217  /* force the item to create its string value too. This can save */
1218  /* us a lot of time when string indices are used for compound */
1219  /* variables and also eliminate a bunch of old-new table */
1220  /* references. */
1222  }
1223 }
1224 
1225 void RexxIntegerClass::live(size_t liveMark)
1226 /******************************************************************************/
1227 /* Function: Normal garbage collection live marking */
1228 /******************************************************************************/
1229 {
1230  int i; /* loop counter */
1231 
1232  this->RexxClass::live(liveMark); /* do RexxClass level marking */
1233 
1234  /* now mark the cached integers */
1235  for (i = INTEGERCACHELOW; i < INTEGERCACHESIZE ;i++ )
1236  {
1238  }
1239 }
1240 
1242 /******************************************************************************/
1243 /* Function: Generalized object marking */
1244 /******************************************************************************/
1245 {
1246  int i; /* loop counter */
1247 
1248  this->RexxClass::liveGeneral(reason); /* do RexxClass level marking */
1249 
1250  /* now mark the cached integers */
1251  for (i = INTEGERCACHELOW; i < INTEGERCACHESIZE ;i++ )
1252  {
1254  }
1255 }
1256 
1258 /******************************************************************************/
1259 /* Function: Return the String class object for integer instances */
1260 /******************************************************************************/
1261 {
1262  /* just return class from behaviour */
1263  return TheStringClass;
1264 }
1265 
1266 void *RexxInteger::operator new(size_t size)
1267 /******************************************************************************/
1268 /* Function: Create a new integer object */
1269 /******************************************************************************/
1270 {
1271  RexxObject *newObject = new_object(size, T_Integer); /* get a new object */
1272  newObject->setHasNoReferences(); /* Tell GC, not to bother with Live */
1273  return newObject; /* return the new object. */
1274 }
1275 
1277 /******************************************************************************/
1278 /* Function: Create the integer class and set up the integer cache */
1279 /******************************************************************************/
1280 {
1281  /* Create the Integer class object */
1282  /* its asubclass of the CLASS class,*/
1283  /* and needs to override the NEW */
1284  /* method to provide caching */
1285  /* support for integers. */
1286  CLASS_CREATE(Integer, "String", RexxIntegerClass);
1287  /* initialize our static array of */
1288  /* cached integers */
1290 }
1291 
1292 
1294 {
1295  NULL,
1304  (PCPPM)&RexxInteger::concat, /* Duplicate entry neccessary */
1312  /* Duplicate entry neccessary */
1321  /* Duplicate entry neccessary */
1330 };
1331 
RexxInteger::strictNotEqual
RexxInteger * strictNotEqual(RexxObject *)
Definition: IntegerClass.cpp:733
RexxObject::sendMessage
void sendMessage(RexxString *, RexxArray *, ProtectedObject &)
Definition: ObjectClass.cpp:668
RexxExpressionStack
Definition: ExpressionStack.hpp:53
RexxInteger::multiply
RexxObject * multiply(RexxInteger *)
Definition: IntegerClass.cpp:544
logical_t
size_t logical_t
Definition: rexx.h:230
TRACE_PREFIX_LITERAL
Definition: RexxActivity.hpp:86
RexxArray
Definition: ArrayClass.hpp:100
RexxIntegerClass::live
void live(size_t)
Definition: IntegerClass.cpp:1225
RexxObject::isInstanceOf
bool isInstanceOf(RexxClass *)
Definition: ObjectClass.cpp:226
T_Integer
Definition: ClassTypeCodes.h:65
RexxInteger::hashCode
RexxObject * hashCode()
Definition: IntegerClass.cpp:710
RexxObject::truthValue
bool truthValue(int)
Definition: ObjectClass.cpp:468
TheFalseObject
#define TheFalseObject
Definition: RexxCore.h:184
RexxInteger::isGreaterOrEqual
RexxInteger * isGreaterOrEqual(RexxObject *)
Definition: IntegerClass.cpp:799
new_numberstringFromWholenumber
RexxNumberString * new_numberstringFromWholenumber(wholenumber_t n)
Definition: NumberStringClass.hpp:279
new_integer
RexxInteger * new_integer(wholenumber_t v)
Definition: IntegerClass.hpp:198
memory_mark_general
#define memory_mark_general(oref)
Definition: RexxMemory.hpp:437
RexxInteger::operatorMethods
static PCPPM operatorMethods[]
Definition: IntegerClass.hpp:149
RexxActivation.hpp
OrefSet
#define OrefSet(o, r, v)
Definition: RexxCore.h:94
RexxInteger::round
RexxObject * round()
Definition: IntegerClass.cpp:1109
RexxInternalObject::isSameType
bool isSameType(RexxInternalObject *o)
Definition: ObjectClass.hpp:264
RexxInteger::createInstance
static void createInstance()
Definition: IntegerClass.cpp:1276
RexxInteger::integerOne
static RexxInteger * integerOne
Definition: IntegerClass.hpp:157
Numerics::formatWholeNumber
static size_t formatWholeNumber(wholenumber_t integer, char *dest)
Definition: Numerics.cpp:572
RexxInteger::falseObject
static RexxInteger * falseObject
Definition: IntegerClass.hpp:152
RexxInteger::makeString
RexxString * makeString()
Definition: IntegerClass.cpp:128
RexxInteger::getHashValue
virtual HashCode getHashValue()
Definition: IntegerClass.cpp:91
RexxInteger::instanceMethod
RexxMethod * instanceMethod(RexxString *)
Definition: IntegerClass.cpp:445
RexxInteger::integerFour
static RexxInteger * integerFour
Definition: IntegerClass.hpp:160
RexxInteger::setString
void setString(RexxString *string)
Definition: IntegerClass.cpp:348
INTEGERCACHELOW
#define INTEGERCACHELOW
Definition: IntegerClass.hpp:50
RexxInteger::classInstance
static RexxIntegerClass * classInstance
Definition: IntegerClass.hpp:150
Numerics::validMaxWhole
static const wholenumber_t validMaxWhole[]
Definition: Numerics.hpp:83
RexxNumberString::formatRexx
RexxString * formatRexx(RexxObject *, RexxObject *, RexxObject *, RexxObject *)
Definition: NumberStringClass.cpp:1842
RexxString::getLength
size_t getLength()
Definition: StringClass.hpp:330
RexxIntegerClass::integercache
RexxInteger * integercache[100 - -10]
Definition: IntegerClass.hpp:194
requiredArgument
void requiredArgument(RexxObject *object, size_t position)
Definition: RexxCore.h:284
RexxInteger::evaluate
RexxObject * evaluate(RexxActivation *, RexxExpressionStack *)
Definition: IntegerClass.cpp:1147
RexxInteger::strictGreaterOrEqual
RexxInteger * strictGreaterOrEqual(RexxObject *)
Definition: IntegerClass.cpp:852
RexxObject::hash
HashCode hash()
Definition: ObjectClass.cpp:371
RexxInteger::wholeNumber
wholenumber_t wholeNumber()
Definition: IntegerClass.hpp:142
RexxInteger::logicalValue
virtual bool logicalValue(logical_t &)
Definition: IntegerClass.cpp:385
RexxNumberString::comp
wholenumber_t comp(RexxObject *)
Definition: NumberStringClass.cpp:2766
RexxVariableDictionary
Definition: RexxVariableDictionary.hpp:55
Numerics.hpp
RexxInteger::integerDivide
RexxObject * integerDivide(RexxInteger *)
Definition: IntegerClass.cpp:576
Error_Incorrect_method_noarg
#define Error_Incorrect_method_noarg
Definition: RexxErrorCodes.h:457
reportException
void reportException(wholenumber_t error)
Definition: ActivityManager.hpp:136
RexxActivation::traceIntermediate
void traceIntermediate(RexxObject *v, int p)
Definition: RexxActivation.hpp:373
RexxInteger::equal
RexxInteger * equal(RexxObject *)
Definition: IntegerClass.cpp:747
RexxIntegerClass
Definition: IntegerClass.hpp:176
Numerics::MAX_WHOLENUMBER
static const wholenumber_t MAX_WHOLENUMBER
Definition: Numerics.hpp:62
RexxInteger::integerZero
static RexxInteger * integerZero
Definition: IntegerClass.hpp:156
RexxInteger::plus
RexxObject * plus(RexxInteger *)
Definition: IntegerClass.cpp:492
RexxInteger::divide
RexxObject * divide(RexxInteger *)
Definition: IntegerClass.cpp:566
RexxString::isEqual
bool isEqual(RexxObject *)
Definition: StringClass.cpp:482
RexxInteger::hasMethod
RexxInteger * hasMethod(RexxString *)
Definition: IntegerClass.cpp:147
RexxInteger::primitiveMakeString
RexxString * primitiveMakeString()
Definition: IntegerClass.cpp:156
RexxInteger::minus
RexxObject * minus(RexxInteger *)
Definition: IntegerClass.cpp:517
TheTrueObject
#define TheTrueObject
Definition: RexxCore.h:185
RexxSupplier
Definition: SupplierClass.hpp:47
RexxInteger::numberValue
bool numberValue(wholenumber_t &result, size_t precision)
Definition: IntegerClass.cpp:283
RexxString::getStringData
const char * getStringData()
Definition: StringClass.hpp:333
RexxString::makeArray
RexxArray * makeArray()
Definition: StringClass.cpp:219
RexxEnvelope
Definition: RexxEnvelope.hpp:53
RexxInternalObject::isSubClassOrEnhanced
bool isSubClassOrEnhanced()
Definition: ObjectClass.cpp:158
IntegerZero
#define IntegerZero
Definition: RexxCore.h:188
RexxInteger::value
wholenumber_t value
Definition: IntegerClass.hpp:171
RexxInteger::comp
wholenumber_t comp(RexxObject *other)
Definition: IntegerClass.cpp:688
isOfClass
#define isOfClass(t, r)
Definition: RexxCore.h:211
RexxInteger::concat
RexxString * concat(RexxString *)
Definition: IntegerClass.cpp:480
RexxInteger::integerNine
static RexxInteger * integerNine
Definition: IntegerClass.hpp:165
RexxInteger::strictGreaterThan
RexxInteger * strictGreaterThan(RexxObject *)
Definition: IntegerClass.cpp:826
RexxInteger::copyIntoTail
void copyIntoTail(RexxCompoundTail *)
Definition: IntegerClass.cpp:198
RexxInteger::concatBlank
RexxString * concatBlank(RexxString *)
Definition: IntegerClass.cpp:468
RexxInteger::trunc
RexxObject * trunc(RexxObject *)
Definition: IntegerClass.cpp:1072
RexxInteger::integerEight
static RexxInteger * integerEight
Definition: IntegerClass.hpp:164
RexxCompoundTail.hpp
TheStringClass
#define TheStringClass
Definition: RexxCore.h:162
RexxInteger::d2c
RexxObject * d2c(RexxObject *)
Definition: IntegerClass.cpp:1127
RexxString::numberString
RexxNumberString * numberString()
Definition: StringClass.cpp:366
new_string
RexxString * new_string(const char *s, stringsize_t l)
Definition: StringClass.hpp:524
RexxInteger::strictLessOrEqual
RexxInteger * strictLessOrEqual(RexxObject *)
Definition: IntegerClass.cpp:865
RexxInternalObject::setHasReferences
void setHasReferences()
Definition: ObjectClass.hpp:239
RexxInteger::getValue
RexxObject * getValue(RexxActivation *)
Definition: IntegerClass.cpp:1162
HashCode
size_t HashCode
Definition: ObjectClass.hpp:77
ARG_ONE
const int ARG_ONE
Definition: RexxCore.h:80
RexxInteger::orOp
RexxObject * orOp(RexxObject *)
Definition: IntegerClass.cpp:912
OREF_NULL
#define OREF_NULL
Definition: RexxCore.h:60
RexxInteger::stringValue
RexxString * stringValue()
Definition: IntegerClass.cpp:177
ArrayClass.hpp
RexxInteger::d2x
RexxObject * d2x(RexxObject *)
Definition: IntegerClass.cpp:1137
RexxInteger::integerSeven
static RexxInteger * integerSeven
Definition: IntegerClass.hpp:163
RexxInteger::andOp
RexxObject * andOp(RexxObject *)
Definition: IntegerClass.cpp:897
RexxInteger::nullPointer
static RexxInteger * nullPointer
Definition: IntegerClass.hpp:154
RexxClass
Definition: ClassClass.hpp:49
RexxNumberString::abs
RexxNumberString * abs()
Definition: NumberStringClass.cpp:3206
flatten_reference
#define flatten_reference(oref, envel)
Definition: RexxMemory.hpp:440
RexxInteger::isGreaterThan
RexxInteger * isGreaterThan(RexxObject *)
Definition: IntegerClass.cpp:773
cleanUpFlatten
#define cleanUpFlatten
Definition: RexxMemory.hpp:432
RexxInteger::strictComp
wholenumber_t strictComp(RexxObject *)
Definition: IntegerClass.cpp:660
RexxInteger::trueObject
static RexxInteger * trueObject
Definition: IntegerClass.hpp:153
RexxInteger::liveGeneral
void liveGeneral(int reason)
Definition: IntegerClass.cpp:106
StringClass.hpp
RexxInteger::getRealValue
RexxObject * getRealValue(RexxActivation *)
Definition: IntegerClass.cpp:1182
RexxInteger::Min
RexxObject * Min(RexxObject **, size_t)
Definition: IntegerClass.cpp:1025
Error_Overflow_zero
#define Error_Overflow_zero
Definition: RexxErrorCodes.h:376
RexxInteger::strictLessThan
RexxInteger * strictLessThan(RexxObject *)
Definition: IntegerClass.cpp:839
RexxClass::live
void live(size_t)
Definition: ClassClass.cpp:66
RexxClass::liveGeneral
void liveGeneral(int reason)
Definition: ClassClass.cpp:85
PCPPM
RexxObject *(RexxObject::* PCPPM)()
Definition: ObjectClass.hpp:198
RexxInteger::power
RexxObject * power(RexxObject *)
Definition: IntegerClass.cpp:630
RexxString::concatWith
RexxString * concatWith(RexxString *, char)
Definition: StringClass.cpp:1743
RexxNumberString::Max
RexxNumberString * Max(RexxObject **, size_t)
Definition: NumberStringClass.cpp:3248
RexxInteger::isLessOrEqual
RexxInteger * isLessOrEqual(RexxObject *)
Definition: IntegerClass.cpp:812
IntegerOne
#define IntegerOne
Definition: RexxCore.h:189
INTEGERCACHESIZE
#define INTEGERCACHESIZE
Definition: IntegerClass.hpp:51
Numerics::DEFAULT_DIGITS
static const size_t DEFAULT_DIGITS
Definition: Numerics.hpp:66
CLASS_CREATE
#define CLASS_CREATE(name, id, className)
Definition: RexxMemory.hpp:445
RexxIntegerClass::liveGeneral
void liveGeneral(int reason)
Definition: IntegerClass.cpp:1241
RexxExpressionStack::push
void push(RexxObject *value)
Definition: ExpressionStack.hpp:77
RexxCompoundTail::append
void append(const char *newData, size_t stringLen)
Definition: RexxCompoundTail.hpp:117
memory_mark
#define memory_mark(oref)
Definition: RexxMemory.hpp:436
integer_forward
#define integer_forward(s, m, o)
Definition: IntegerClass.cpp:408
RexxInteger::format
RexxObject * format(RexxObject *, RexxObject *, RexxObject *, RexxObject *)
Definition: IntegerClass.cpp:1115
RexxIntegerClass::RexxIntegerClass
RexxIntegerClass()
Definition: IntegerClass.cpp:1205
RexxInteger::unknown
RexxObject * unknown(RexxString *, RexxArray *)
Definition: IntegerClass.cpp:410
REQUEST_STRING
RexxString * REQUEST_STRING(RexxObject *object)
Definition: RexxCore.h:276
RexxActivation
Definition: RexxActivation.hpp:156
RexxInteger::xorOp
RexxObject * xorOp(RexxObject *)
Definition: IntegerClass.cpp:927
RexxInteger::stringrep
RexxString * stringrep
Definition: IntegerClass.hpp:170
RexxInternalObject::setHasNoReferences
void setHasNoReferences()
Definition: ObjectClass.hpp:240
RexxNumberString
Definition: NumberStringClass.hpp:93
RexxObject::hasMethod
virtual RexxInteger * hasMethod(RexxString *msg)
Definition: ObjectClass.cpp:1558
RexxInteger::strictEqual
RexxInteger * strictEqual(RexxObject *)
Definition: IntegerClass.cpp:718
RexxInteger::unsignedNumberValue
bool unsignedNumberValue(stringsize_t &result, size_t precision)
Definition: IntegerClass.cpp:327
wholenumber_t
ssize_t wholenumber_t
Definition: rexx.h:229
RexxInteger::notEqual
RexxInteger * notEqual(RexxObject *)
Definition: IntegerClass.cpp:760
RexxNumberString::d2xD2c
RexxString * d2xD2c(RexxObject *, bool)
Definition: NumberStringClass.cpp:3358
RexxObject::instanceMethod
RexxMethod * instanceMethod(RexxString *)
Definition: ObjectClass.cpp:269
RexxInteger::notOp
RexxObject * notOp()
Definition: IntegerClass.cpp:878
RexxInteger::flatten
void flatten(RexxEnvelope *)
Definition: IntegerClass.cpp:115
stringsize_t
size_t stringsize_t
Definition: rexx.h:228
number_digits
size_t number_digits()
Definition: Numerics.hpp:147
RexxInteger::integerSix
static RexxInteger * integerSix
Definition: IntegerClass.hpp:162
RexxInteger::Max
RexxObject * Max(RexxObject **, size_t)
Definition: IntegerClass.cpp:977
RexxInteger::isLessThan
RexxInteger * isLessThan(RexxObject *)
Definition: IntegerClass.cpp:786
RexxInteger::remainder
RexxObject * remainder(RexxInteger *)
Definition: IntegerClass.cpp:603
setUpFlatten
#define setUpFlatten(type)
Definition: RexxMemory.hpp:427
RexxString::getHashValue
virtual HashCode getHashValue()
Definition: StringClass.cpp:95
RexxInteger::live
void live(size_t)
Definition: IntegerClass.cpp:97
TheNilObject
#define TheNilObject
Definition: RexxCore.h:180
RexxInteger::integerThree
static RexxInteger * integerThree
Definition: IntegerClass.hpp:159
Error_Logical_value_method
#define Error_Logical_value_method
Definition: RexxErrorCodes.h:273
RexxInteger::classObject
RexxClass * classObject()
Definition: IntegerClass.cpp:1257
RexxInteger::sign
RexxObject * sign()
Definition: IntegerClass.cpp:961
RexxInteger::integerFive
static RexxInteger * integerFive
Definition: IntegerClass.hpp:161
RexxActivity.hpp
RexxInteger::integerValue
RexxInteger * integerValue(size_t)
Definition: IntegerClass.cpp:339
RexxNumberString::Min
RexxNumberString * Min(RexxObject **, size_t)
Definition: NumberStringClass.cpp:3258
RexxInteger::doubleValue
bool doubleValue(double &result)
Definition: IntegerClass.cpp:243
RexxInteger::instanceMethods
RexxSupplier * instanceMethods(RexxClass *)
Definition: IntegerClass.cpp:462
RexxString::strictComp
wholenumber_t strictComp(RexxObject *)
Definition: StringClass.cpp:700
RexxNumberString::trunc
RexxObject * trunc(RexxObject *)
Definition: NumberStringClass.cpp:1296
RexxCore.h
RexxInteger::floor
RexxObject * floor()
Definition: IntegerClass.cpp:1087
RexxInteger::integerTwo
static RexxInteger * integerTwo
Definition: IntegerClass.hpp:158
RexxInteger::abs
RexxObject * abs()
Definition: IntegerClass.cpp:944
Numerics::MIN_WHOLENUMBER
static const wholenumber_t MIN_WHOLENUMBER
Definition: Numerics.hpp:63
RexxCompoundTail
Definition: RexxCompoundTail.hpp:52
RexxMethod
Definition: MethodClass.hpp:101
new_object
RexxObject * new_object(size_t s)
Definition: RexxMemory.hpp:422
RexxInteger::truthValue
bool truthValue(int)
Definition: IntegerClass.cpp:359
RexxInteger::operatorNot
RexxObject * operatorNot(RexxObject *)
Definition: IntegerClass.cpp:887
RexxInteger::ceiling
RexxObject * ceiling()
Definition: IntegerClass.cpp:1098
RexxInteger::isInstanceOf
bool isInstanceOf(RexxClass *)
Definition: IntegerClass.cpp:431
RexxInteger
Definition: IntegerClass.hpp:56
RexxObject::instanceMethods
RexxSupplier * instanceMethods(RexxClass *)
Definition: ObjectClass.cpp:312
Numerics::abs
static wholenumber_t abs(wholenumber_t n)
Definition: Numerics.hpp:115
RexxInteger::integerMinusOne
static RexxInteger * integerMinusOne
Definition: IntegerClass.hpp:166
RexxString::concat
RexxString * concat(RexxString *)
Definition: StringClass.cpp:1172
RexxObject
Definition: ObjectClass.hpp:311
TheIntegerClass
#define TheIntegerClass
Definition: RexxCore.h:151
RexxString
Definition: StringClass.hpp:119
RexxInteger::numberString
RexxNumberString * numberString()
Definition: IntegerClass.cpp:218
RexxInteger::makeArray
RexxArray * makeArray()
Definition: IntegerClass.cpp:142
RexxInteger::isEqual
bool isEqual(RexxObject *)
Definition: IntegerClass.cpp:640