Skip to content

Commit 6a89302

Browse files
Fix #68
1 parent d0acf00 commit 6a89302

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/Math-Complex/PMComplex.class.st

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,11 @@ PMComplex >> sign [
650650
^ real sign
651651
]
652652

653+
{ #category : #testing }
654+
PMComplex >> signBit [
655+
^self real signBit
656+
]
657+
653658
{ #category : #'mathematical functions' }
654659
PMComplex >> sin [
655660
"Answer receiver's sine."

src/Math-Complex/PMComplex.extension.st

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ PMComplex >> productWithVector: aVector [
1717
^ aVector collect: [ :each | each * self ]
1818
]
1919

20+
{ #category : #'*Math-Complex' }
21+
PMComplex class >> random [
22+
"Answers a random number with abs between 0 and 1."
23+
24+
^ self abs: 1.0 random arg: 2 * Float pi random
25+
]
26+
2027
{ #category : #'*Math-Complex' }
2128
PMComplex >> random [
2229
"analog to Number>>random. However, the only bound is that the abs of the produced complex is less than the length of the receive. The receiver effectively defines a disc within which the random element can be produced."
2330
^ self class random * self
2431

2532
]
2633

27-
{ #category : #'*Math-Complex' }
28-
PMComplex classSide >> random [
29-
"Answers a random number with abs between 0 and 1."
30-
31-
^ self abs: 1.0 random arg: 2 * Float pi random
32-
]
33-
3434
{ #category : #'*Math-Complex' }
3535
PMComplex >> subtractToPolynomial: aPolynomial [
3636
^ aPolynomial addNumber: self negated

0 commit comments

Comments
 (0)