The Trunk: EToys-nice.272.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: EToys-nice.272.mcz

commits-2
Nicolas Cellier uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-nice.272.mcz

==================== Summary ====================

Name: EToys-nice.272
Author: nice
Time: 30 October 2016, 10:20:54.285252 pm
UUID: c45ec8ec-6f58-4784-992b-2f314c32c548
Ancestors: EToys-nice.271

exponent is defined in subclasses.
cubeRoot is nthRoot: 3.

=============== Diff against EToys-nice.271 ===============

Item was removed:
- ----- Method: Float>>cubeRoot (in category '*Etoys-Squeakland-mathematical functions') -----
- cubeRoot
- "Answer the cube root of the receiver."
-
- ^ self sign *  (self abs raisedTo: 1 / 3)
-
- "
- 8 cubeRoot
- 0 cubeRoot
- 1728 cubeRoot
- 3.14159265 cubeRoot
- "!

Item was removed:
- ----- Method: Float>>exponent (in category '*Etoys-Squeakland-truncation and round off') -----
- exponent
- "Primitive. Consider the receiver to be represented as a power of two
- multiplied by a mantissa (between one and two). Answer with the
- SmallInteger to whose power two is raised. Optional. See Object
- documentation whatIsAPrimitive."
-
- | positive |
- <primitive: 53>
- self >= 1.0 ifTrue: [^self floorLog: 2].
- self > 0.0
- ifTrue:
- [positive := (1.0 / self) exponent.
- self = (1.0 / (1.0 timesTwoPower: positive))
- ifTrue: [^positive negated]
- ifFalse: [^positive negated - 1]].
- self = 0.0 ifTrue: [^-1].
- ^self negated exponent!

Item was changed:
  ----- Method: Number>>cubeRoot (in category '*Etoys-Squeakland-mathematical functions') -----
  cubeRoot
  "Answer the cube root of the receiver."
 
+ ^ self nthRoot: 3!
- ^ self asFloat cubeRoot!