Skip to content

Commit

Permalink
Migrate packages to Tonel v3 format
Browse files Browse the repository at this point in the history
  • Loading branch information
gcotelli committed May 9, 2024
1 parent c940229 commit a3c3f6f
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DateAndTimeANSI >> monthIndex [
{ #category : '*Buoy-Chronology-GS64-Extensions' }
DateAndTimeANSI >> printHMSOn: aStream [

self printHMSOn: aStream separatedBy: $:
self printHMSOn: aStream separatedBy: $:
]

{ #category : '*Buoy-Chronology-GS64-Extensions' }
Expand Down
22 changes: 11 additions & 11 deletions source/Buoy-Math-GS64-Base-Extensions/BinaryFloat.extension.st
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Extension { #name : #BinaryFloat }
Extension { #name : 'BinaryFloat' }

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
BinaryFloat >> closeTo: num [
"Tell whether the receiver and arguments are close from each."

^ self closeTo: num precision: 0.0001
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
BinaryFloat >> closeTo: num precision: aPrecision [
"Tell whether the receiver and arguments are close from each other given a precision"

Expand All @@ -16,51 +16,51 @@ BinaryFloat >> closeTo: num precision: aPrecision [
^ self = num asFloat or: [ (self - num) abs <= aPrecision ]
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
BinaryFloat class >> infinity [

^ PlusInfinity
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
BinaryFloat >> isFinite [

^ #( #normal #subnormal #zero ) includes: self kind
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
BinaryFloat >> isInfinite [

^ self kind = #infinity
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
BinaryFloat >> isNaN [

^ #( #quietNaN #signalingNaN ) includes: self kind
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
BinaryFloat class >> nan [

^ MinusQuietNaN
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
BinaryFloat class >> negativeInfinity [

^ MinusInfinity
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
BinaryFloat class >> readFrom: aStringOrStream [

^ aStringOrStream isString
ifTrue: [ self fromString: aStringOrStream ]
ifFalse: [ self fromStream: aStringOrStream ]
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
BinaryFloat class >> zero [
^ 0.0
]
31 changes: 18 additions & 13 deletions source/Buoy-Math-GS64-Base-Extensions/DomainError.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,40 @@ I am DomainError, an ArithmeticException indicating that some argument falls out
When my valid interval is left- or right-open, use signal: creation protocol to provide a custom messageText rather than the default [from, to] notation.
"
Class {
#name : #DomainError,
#superclass : #ArithmeticError,
#name : 'DomainError',
#superclass : 'ArithmeticError',
#instVars : [
'from',
'to'
],
#category : #'Buoy-Math-GS64-Base-Extensions'
#category : 'Buoy-Math-GS64-Base-Extensions',
#package : 'Buoy-Math-GS64-Base-Extensions'
}

{ #category : #signaling }
{ #category : 'signaling' }
DomainError class >> signal: signallerText from: start [
^ self signal: signallerText from: start to: Float infinity
]

{ #category : #signaling }
{ #category : 'signaling' }
DomainError class >> signal: signallerText from: start to: end [
^ self new
from: start;
to: end;
signal: signallerText
]

{ #category : #signaling }
{ #category : 'signaling' }
DomainError class >> signal: signallerText to: end [
^ self signal: signallerText from: Float infinity negated to: end
]

{ #category : #signaling }
{ #category : 'signaling' }
DomainError class >> signalFrom: start [
^ self signalFrom: start to: Float infinity
]

{ #category : #signaling }
{ #category : 'signaling' }
DomainError class >> signalFrom: start to: end [
| msgStart msgEnd |
msgStart := (start isFloat and: [start isFinite not]) ifTrue: ['(-infinity'] ifFalse: ['[', start printString].
Expand All @@ -46,27 +47,31 @@ DomainError class >> signalFrom: start to: end [
to: end
]

{ #category : #signaling }
{ #category : 'signaling' }
DomainError class >> signalTo: end [
^ self signalFrom: Float infinity negated to: end
]

{ #category : #accessing }
{ #category : 'accessing' }
DomainError >> from [

^ from
]

{ #category : #accessing }
{ #category : 'accessing' }
DomainError >> from: start [

from := start
]

{ #category : #accessing }
{ #category : 'accessing' }
DomainError >> to [

^ to
]

{ #category : #accessing }
{ #category : 'accessing' }
DomainError >> to: end [

to := end
]
16 changes: 8 additions & 8 deletions source/Buoy-Math-GS64-Base-Extensions/Integer.extension.st
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
Extension { #name : #Integer }
Extension { #name : 'Integer' }

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
Integer >> asHexStringPaddedTo: minimum [

^ (self asHexStringWithLength: minimum) asUppercase
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
Integer >> atRandom [

self = 0 ifTrue: [ ^ 0 ].
^ Random new integerBetween: 1 and: self abs
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
Integer >> hashMultiply [
"No need to do something special in GS64"

^ self
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
Integer >> isInteger [
"True for all subclasses of Integer."

^ true
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
Integer >> printStringHex [

^ self asHexString asUppercase
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
Integer >> printStringLength: minimum padded: zeroFlag [

| numberPrintString preffix |
Expand All @@ -52,7 +52,7 @@ Integer >> printStringLength: minimum padded: zeroFlag [
stream nextPutAll: numberPrintString ]
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
Integer class >> readFrom: aStringOrStream ifFail: aBlock [

^ [
Expand Down
18 changes: 9 additions & 9 deletions source/Buoy-Math-GS64-Base-Extensions/Number.extension.st
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
Extension { #name : #Number }
Extension { #name : 'Number' }

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
Number >> asNumber [

^ self
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
Number >> closeTo: num [
"Tell whether the receiver and arguments are close from each."

^ self asFloat closeTo: num
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
Number >> isInteger [

^ false
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
Number >> isNaN [
^ false
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
Number >> isZero [

^ self = 0
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
Number >> nthRoot: aPositiveInteger [

^ self raisedTo: aPositiveInteger reciprocal
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
Number class >> readFrom: aStringOrStream ifFail: aBlock [

^ [
Expand All @@ -51,7 +51,7 @@ Number class >> readFrom: aStringOrStream ifFail: aBlock [
do: [ :error | error return: aBlock value ]
]

{ #category : #'*Buoy-Math-GS64-Base-Extensions' }
{ #category : '*Buoy-Math-GS64-Base-Extensions' }
Number >> round: numberOfWishedDecimal [

^ self roundTo: (10 raisedTo: numberOfWishedDecimal negated)
Expand Down
2 changes: 1 addition & 1 deletion source/Buoy-Math-GS64-Base-Extensions/package.st
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : #'Buoy-Math-GS64-Base-Extensions' }
Package { #name : 'Buoy-Math-GS64-Base-Extensions' }
12 changes: 6 additions & 6 deletions source/Buoy-Math-GS64-Extensions/PartsPerFraction.extension.st
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
Extension { #name : #PartsPerFraction }
Extension { #name : 'PartsPerFraction' }

{ #category : #'*Buoy-Math-GS64-Extensions' }
{ #category : '*Buoy-Math-GS64-Extensions' }
PartsPerFraction >> _coerce: aNumber [

^self class ratio: (ratio _coerce: aNumber)
^ self class ratio: ( ratio _coerce: aNumber )
]

{ #category : #'*Buoy-Math-GS64-Extensions' }
{ #category : '*Buoy-Math-GS64-Extensions' }
PartsPerFraction >> _generality [

^ ratio _generality + 1
]

{ #category : #'*Buoy-Math-GS64-Extensions' }
{ #category : '*Buoy-Math-GS64-Extensions' }
PartsPerFraction >> printOn: stream [

self value printOn: stream
]

{ #category : #'*Buoy-Math-GS64-Extensions' }
{ #category : '*Buoy-Math-GS64-Extensions' }
PartsPerFraction >> printString [

^ String streamContents: [ :stream | self printOn: stream ]
Expand Down
4 changes: 2 additions & 2 deletions source/Buoy-Math-GS64-Extensions/PerMille.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #PerMille }
Extension { #name : 'PerMille' }

{ #category : #'*Buoy-Math-GS64-Extensions' }
{ #category : '*Buoy-Math-GS64-Extensions' }
PerMille >> printOn: stream [

super printOn: stream.
Expand Down
4 changes: 2 additions & 2 deletions source/Buoy-Math-GS64-Extensions/Percentage.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #Percentage }
Extension { #name : 'Percentage' }

{ #category : #'*Buoy-Math-GS64-Extensions' }
{ #category : '*Buoy-Math-GS64-Extensions' }
Percentage >> printOn: stream [

super printOn: stream.
Expand Down
2 changes: 1 addition & 1 deletion source/Buoy-Math-GS64-Extensions/package.st
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : #'Buoy-Math-GS64-Extensions' }
Package { #name : 'Buoy-Math-GS64-Extensions' }
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ TestAsserter >> deny: actual identicalTo: expected [

{ #category : '*Buoy-SUnit-GS64-Extensions' }
TestAsserter >> fail [
"I make my receiver fail with TestFailure"

^ self assert: false
]
Expand Down

0 comments on commit a3c3f6f

Please sign in to comment.