The Trunk: Kernel-nice.1203.mcz

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

The Trunk: Kernel-nice.1203.mcz

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

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

Name: Kernel-nice.1203
Author: nice
Time: 12 December 2018, 12:58:33.810289 am
UUID: 1fdf8772-d764-cd42-9291-fb7464d23204
Ancestors: Kernel-nice.1202

Micro-optimization: use knowledge of SmallFloat64 representation: due to restricted exponent range, they can't be infinite nor nan (nor subnormal, but we don't ask).

Let a comment be more accurate, primitive 75 does not only fail for SmallInteger, but also for any other immediate value.

=============== Diff against Kernel-nice.1202 ===============

Item was changed:
  ----- Method: ProtoObject>>identityHash (in category 'comparing') -----
  identityHash
  "Answer a SmallInteger whose value is related to the receiver's identity.
+ This method must not be overridden, except by immediate values.
+ Primitive. Fails if the receiver is immediate. Essential.
- This method must not be overridden, except by SmallInteger.
- Primitive. Fails if the receiver is a SmallInteger. Essential.
  See Object documentation whatIsAPrimitive.
 
  Do not override."
 
  <primitive: 75>
  self primitiveFailed!

Item was added:
+ ----- Method: SmallFloat64>>isFinite (in category 'testing') -----
+ isFinite
+ "A SmallFloat64 is always finite.
+ Infinity or nan require large exponent that does not fit."
+
+ ^true!

Item was added:
+ ----- Method: SmallFloat64>>isInfinite (in category 'testing') -----
+ isInfinite
+ "A SmallFloat64 is never infinite.
+ Infinity require large exponent that does not fit."
+
+ ^false!

Item was added:
+ ----- Method: SmallFloat64>>isNaN (in category 'testing') -----
+ isNaN
+ "A SmallFloat64 is never nan.
+ nan require large exponent that does not fit."
+
+ ^false!