Uh oh. Your #asNonFraction addition is fine now, I would have committed that.
But now I'll have to wait until someone confirms the changed ceiling code is good. Nicolas maybe?
- Bert -
On 29.05.2011, at 22:32, commits@source.squeak.org wrote:
A new version of Kernel was added to project The Inbox: http://source.squeak.org/inbox/Kernel-wiz.592.mcz
==================== Summary ====================
Name: Kernel-wiz.592 Author: wiz Time: 29 May 2011, 6:40:45.398 pm UUID: ce3c0c86-e4f2-4bf5-8c2a-efbc708af821 Ancestors: Kernel-wiz.591
asNonFraction with updated comments.
ceiling speed up for positive numbers by mirroring floor code rathar than calling floor.
=============== Diff against Kernel-wiz.591 ===============
Item was changed: ----- Method: Fraction>>asNonFraction (in category 'converting') ----- asNonFraction
- "Answer a number equivalent to the receiver that is not a fraction."
- "Answer the receiver asFloat. This is here for the benifit of the copyBits primitive which can handle floats but not fractions. It has to be stated this way so we don't turn integers into floats. See inheritance for backstop"
- ^self asFloat!
Item was changed: ----- Method: Number>>asNonFraction (in category 'converting') ----- asNonFraction
- "Answer a number equivalent to the receiver that is not a fraction. See Fraction for active method."
"Answer the receiver. This is here for the benifit of the copyBits primitive which can handle floats but not fractions. It has to be stated this way so we don't turn integers into floats. See Fraction for active method"
^self !
Item was changed: ----- Method: Number>>ceiling (in category 'truncation and round off') ----- ceiling
- "Answer the integer nearest the receiver toward infinity."
- "Answer the integer nearest the receiver toward positive infinity."
- | truncation |
- truncation := self truncated.
- self <= 0 ifTrue: [^truncation].
- self = truncation
ifTrue: [^truncation]
ifFalse: [^truncation + 1]!
- self <= 0.0
ifTrue: [^self truncated]
ifFalse: [^self negated floor negated]!
According to the tests I just published, it's OK.
Nicolas
2011/5/30 Bert Freudenberg bert@freudenbergs.de:
Uh oh. Your #asNonFraction addition is fine now, I would have committed that.
But now I'll have to wait until someone confirms the changed ceiling code is good. Nicolas maybe?
- Bert -
On 29.05.2011, at 22:32, commits@source.squeak.org wrote:
A new version of Kernel was added to project The Inbox: http://source.squeak.org/inbox/Kernel-wiz.592.mcz
==================== Summary ====================
Name: Kernel-wiz.592 Author: wiz Time: 29 May 2011, 6:40:45.398 pm UUID: ce3c0c86-e4f2-4bf5-8c2a-efbc708af821 Ancestors: Kernel-wiz.591
asNonFraction with updated comments.
ceiling speed up for positive numbers by mirroring floor code rathar than calling floor.
=============== Diff against Kernel-wiz.591 ===============
Item was changed: ----- Method: Fraction>>asNonFraction (in category 'converting') ----- asNonFraction
- "Answer a number equivalent to the receiver that is not a fraction."
- "Answer the receiver asFloat. This is here for the benifit of the copyBits primitive which can handle floats but not fractions. It has to be stated this way so we don't turn integers into floats. See inheritance for backstop"
^self asFloat!
Item was changed: ----- Method: Number>>asNonFraction (in category 'converting') ----- asNonFraction
- "Answer a number equivalent to the receiver that is not a fraction. See Fraction for active method."
- "Answer the receiver. This is here for the benifit of the copyBits primitive which can handle floats but not fractions. It has to be stated this way so we don't turn integers into floats. See Fraction for active method"
^self !
Item was changed: ----- Method: Number>>ceiling (in category 'truncation and round off') ----- ceiling
- "Answer the integer nearest the receiver toward infinity."
- "Answer the integer nearest the receiver toward positive infinity."
- | truncation |
- truncation := self truncated.
- self <= 0 ifTrue: [^truncation].
- self = truncation
- ifTrue: [^truncation]
- ifFalse: [^truncation + 1]!
- self <= 0.0
- ifTrue: [^self truncated]
- ifFalse: [^self negated floor negated]!
On 03.06.2011, at 21:54, Nicolas Cellier wrote:
According to the tests I just published, it's OK.
Nicolas
Great. I committed it.
- Bert -
2011/5/30 Bert Freudenberg bert@freudenbergs.de:
Uh oh. Your #asNonFraction addition is fine now, I would have committed that.
But now I'll have to wait until someone confirms the changed ceiling code is good. Nicolas maybe?
- Bert -
On 29.05.2011, at 22:32, commits@source.squeak.org wrote:
A new version of Kernel was added to project The Inbox: http://source.squeak.org/inbox/Kernel-wiz.592.mcz
==================== Summary ====================
Name: Kernel-wiz.592 Author: wiz Time: 29 May 2011, 6:40:45.398 pm UUID: ce3c0c86-e4f2-4bf5-8c2a-efbc708af821 Ancestors: Kernel-wiz.591
asNonFraction with updated comments.
ceiling speed up for positive numbers by mirroring floor code rathar than calling floor.
=============== Diff against Kernel-wiz.591 ===============
Item was changed: ----- Method: Fraction>>asNonFraction (in category 'converting') ----- asNonFraction
"Answer a number equivalent to the receiver that is not a fraction."
"Answer the receiver asFloat. This is here for the benifit of the copyBits primitive which can handle floats but not fractions. It has to be stated this way so we don't turn integers into floats. See inheritance for backstop"
^self asFloat!
Item was changed: ----- Method: Number>>asNonFraction (in category 'converting') ----- asNonFraction
"Answer a number equivalent to the receiver that is not a fraction. See Fraction for active method."
"Answer the receiver. This is here for the benifit of the copyBits primitive which can handle floats but not fractions. It has to be stated this way so we don't turn integers into floats. See Fraction for active method" ^self !
Item was changed: ----- Method: Number>>ceiling (in category 'truncation and round off') ----- ceiling
"Answer the integer nearest the receiver toward infinity."
"Answer the integer nearest the receiver toward positive infinity."
| truncation |
truncation := self truncated.
self <= 0 ifTrue: [^truncation].
self = truncation
ifTrue: [^truncation]
ifFalse: [^truncation + 1]!
self <= 0.0
ifTrue: [^self truncated]
ifFalse: [^self negated floor negated]!
squeak-dev@lists.squeakfoundation.org