Hi Mark,
the code from Number>>raisedTo:
aNumber isInteger ifTrue: [
"Do the special case of integer power"
^ self raisedToInteger: aNumber].
aNumber isFraction ifTrue: [
"Special case for fraction power"
^ (self nthRoot: aNumber denominator) raisedToInteger: aNumber
numerator ].
self < 0 ifTrue: [
^ ArithmeticError signal: 'Negative numbers can''t be raised to
float powers.' ].
0 = aNumber ifTrue: [^ self class one]. "Special case of exponent=0"
1 = aNumber ifTrue: [^ self]. "Special case of exponent=1"
0 = self ifTrue: [ "Special case of self = 0"
aNumber < 0
ifTrue: [^ (ZeroDivide dividend: self) signal]
ifFalse: [^ self]].
^ (aNumber * self ln) exp "Otherwise use logarithms"
Werner
p.s. Hi Ben, <g> yes, i wrote that email a bit too fast, the video from
http://www.screencast.com/t/LCEl0hFl
On 06/07/2017 07:03 PM, Mark Rizun wrote:
Hi Werner,
I believe that I am the one to answer this question, but I need more
information.
Please, could you send the code that you have in upper left panel.
Cheers,
Mark
2017-06-07 18:46 GMT+02:00 Ben Coman <b...@openinworld.com
<mailto:b...@openinworld.com>>:
I don't know much about RewriteToolbuilder, so probably won't be
the one to give a proper answer,
but to help someone else answer... could you narrow down which
video with a link?
cheers -ben
On Thu, Jun 8, 2017 at 12:05 AM, werner kassens
<wkass...@libello.com <mailto:wkass...@libello.com>> wrote:
Hi,
i followed the video and opened the RewriteToolbuilder on some
code in pharo4.0. i then tried to keep things simple and made
a transformationrule,which i thought would not change
anything, by just copying "‘@.Statements." into the lower left
& right panels (without the " of course).i then press
'generate rule' and get a 'Syntax Error: end of Statement list
encountered' with this specification: ^ ArithmeticError
signal: 'Negative numbers canEnd of statement list encountered
-> ''t be raised to float powers.' . but this part of the code
in the upper left panel is just a copy of some unchanged
standard pharo4.0 code. where did i go wrong?
werner