-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from msgpack/feature/update_for_squeak6-2
- Use bitAnd: , bitOr: for compatibility
- Loading branch information
Showing
3 changed files
with
12 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 10 additions & 1 deletion
11
...gePack-Squeak-Core.package/MpSqPortableUtil.class/instance/timestampFromSeconds.nanos..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
actions | ||
timestampFromSeconds: seconds nanos: nanoSeconds | ||
| microseconds ts | | ||
microseconds := (seconds * 1000000) + (nanoSeconds * 0.001). | ||
microseconds := seconds * 1000000. | ||
nanoSeconds isZero ifFalse: [ | microsPart rem | | ||
rem := nanoSeconds rem: 1000. | ||
rem = 0 ifTrue: [ | ||
microsPart := nanoSeconds / 1000. | ||
] ifFalse: [ | ||
microsPart := nanoSeconds * 0.001. | ||
]. | ||
microseconds := microseconds + microsPart. | ||
]. | ||
ts := DateAndTime utcMicroseconds: microseconds offset: 0. | ||
^ts |