Float.st
changeset 11733 fe4717d35e0c
parent 11721 358878a3860c
child 11926 295e8bb99fde
child 17711 39faaaf888b4
equal deleted inserted replaced
11732:f4ef9b3eb755 11733:fe4717d35e0c
   655 ! !
   655 ! !
   656 
   656 
   657 !Float methodsFor:'arithmetic'!
   657 !Float methodsFor:'arithmetic'!
   658 
   658 
   659 * aNumber
   659 * aNumber
   660     "return the product of the receiver and the argument, aNumber"
   660     "return the product of the receiver and the argument."
   661 
   661 
   662 %{  /* NOCONTEXT */
   662 %{  /* NOCONTEXT */
   663 
   663 
   664     /*
   664     /*
   665      * notice:
   665      * notice:
   672      */
   672      */
   673     OBJ newFloat;
   673     OBJ newFloat;
   674     double result;
   674     double result;
   675 
   675 
   676     if (__isSmallInteger(aNumber)) {
   676     if (__isSmallInteger(aNumber)) {
   677 	result = __floatVal(self) * (double)(__intVal(aNumber));
   677         result = __floatVal(self) * (double)(__intVal(aNumber));
   678 retResult:
   678 retResult:
   679 	__qMKFLOAT(newFloat, result);
   679         __qMKFLOAT(newFloat, result);
   680 	RETURN ( newFloat );
   680         RETURN ( newFloat );
   681     }
   681     }
   682     if (__isFloatLike(aNumber)) {
   682     if (__isFloatLike(aNumber)) {
   683 	result = __floatVal(self) * __floatVal(aNumber);
   683         result = __floatVal(self) * __floatVal(aNumber);
   684 	goto retResult;
   684         goto retResult;
   685     } 
   685     } 
   686     if (__isShortFloat(aNumber)) {
   686     if (__isShortFloat(aNumber)) {
   687 	result = __floatVal(self) * (double)(__shortFloatVal(aNumber));
   687         result = __floatVal(self) * (double)(__shortFloatVal(aNumber));
   688 	goto retResult;
   688         goto retResult;
   689     }
   689     }
   690 %}.
   690 %}.
   691     ^ aNumber productFromFloat:self
   691     ^ aNumber productFromFloat:self
   692 !
   692 !
   693 
   693 
  2677 ! !
  2677 ! !
  2678 
  2678 
  2679 !Float class methodsFor:'documentation'!
  2679 !Float class methodsFor:'documentation'!
  2680 
  2680 
  2681 version
  2681 version
  2682     ^ '$Header: /cvs/stx/stx/libbasic/Float.st,v 1.166 2009-05-26 06:30:52 cg Exp $'
  2682     ^ '$Header: /cvs/stx/stx/libbasic/Float.st,v 1.167 2009-05-26 06:38:10 cg Exp $'
  2683 ! !
  2683 ! !
  2684 
  2684 
  2685 Float initialize!
  2685 Float initialize!