831 " |
832 " |
832 Integer displayRadix:16. 123456 inspect |
833 Integer displayRadix:16. 123456 inspect |
833 Integer displayRadix:10. 123456 inspect |
834 Integer displayRadix:10. 123456 inspect |
834 " |
835 " |
835 ! ! |
836 ! ! |
|
837 |
836 |
838 |
837 !Number class methodsFor:'private'! |
839 !Number class methodsFor:'private'! |
838 |
840 |
839 readMantissaAndScaleFrom:aStream radix:radix |
841 readMantissaAndScaleFrom:aStream radix:radix |
840 "helper for readFrom: - |
842 "helper for readFrom: - |
1083 (2 asFixedPoint:4) sqrtWithErrorLessThan:0.001 |
1086 (2 asFixedPoint:4) sqrtWithErrorLessThan:0.001 |
1084 " |
1087 " |
1085 |
1088 |
1086 "Modified: / 25-07-2017 / 15:58:46 / cg" |
1089 "Modified: / 25-07-2017 / 15:58:46 / cg" |
1087 ! ! |
1090 ! ! |
|
1091 |
1088 |
1092 |
1089 !Number methodsFor:'coercing & converting'! |
1093 !Number methodsFor:'coercing & converting'! |
1090 |
1094 |
1091 i |
1095 i |
1092 "return a complex number, with the receiver as imaginary part, 0 as real part" |
1096 "return a complex number, with the receiver as imaginary part, 0 as real part" |
1712 "/ retry after converting to float |
1716 "/ retry after converting to float |
1713 (self isLimitedPrecisionReal not |
1717 (self isLimitedPrecisionReal not |
1714 or:[self generality < 1.0 generality]) ifTrue:[ |
1718 or:[self generality < 1.0 generality]) ifTrue:[ |
1715 |f| |
1719 |f| |
1716 |
1720 |
1717 "/ do not make this a longfloat; |
1721 "/ do not make this a LongFloat; |
1718 "/ r will return a longFloat then, and Image roated will fail then... |
1722 "/ r will return a LongFloat then, and Image rotated will fail then... |
1719 (f := self asFloat) isFinite ifTrue:[ |
1723 (f := self asFloat) isFinite ifTrue:[ |
1720 ^ f sqrt. |
1724 ^ f sqrt. |
1721 ]. |
1725 ]. |
1722 ]. |
1726 ]. |
1723 "/ very slow fallback |
1727 "/ very slow fallback |
1724 ^ self sqrt_withAccuracy:self epsilon |
1728 ^ self sqrt_withAccuracy:self epsilon |
1725 |
1729 |
1726 "Modified (format): / 11-07-2017 / 13:32:02 / cg" |
1730 "Modified (format): / 11-07-2017 / 13:32:02 / cg" |
|
1731 "Modified (format): / 26-07-2017 / 12:30:16 / mawalch" |
1727 ! |
1732 ! |
1728 |
1733 |
1729 timesTwoPower:anInteger |
1734 timesTwoPower:anInteger |
1730 "Return the receiver multiplied by 2 raised to the power of the argument. |
1735 "Return the receiver multiplied by 2 raised to the power of the argument. |
1731 For protocol completeness wrt. Squeak and ST80." |
1736 For protocol completeness wrt. Squeak and ST80." |