Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move over Sorbet stdlib types for the cmath gem #298

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions index.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
},
"bencode": {
},
"cmath": {
},
"colorize": {
},
"configs": {
Expand Down
62 changes: 62 additions & 0 deletions rbi/annotations/cmath.rbi
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# typed: true

module CMath
include ::Math
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is failing CI for now but the duplication should be fine as users upgrade their Sorbet version. I'd like to keep the CI green though. Is it okay if this PR waits until Sorbet removal is merged and we bump the Sorbet version used in tests?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that makes sense — although we should aim for as little time as possible between the two merges, then.


sig { params(z: Numeric).returns(Float) }
def self.acos(z); end

sig { params(z: Numeric).returns(Float) }
def self.acosh(z); end

sig { params(z: Numeric).returns(Float) }
def self.asin(z); end

sig { params(z: Numeric).returns(Float) }
def self.asinh(z); end

sig { params(z: Numeric).returns(Float) }
def self.atan(z); end

sig { params(y: Numeric, x: Numeric).returns(Float) }
def self.atan2(y, x); end

sig { params(z: Numeric).returns(Float) }
def self.atanh(z); end

sig { params(z: Numeric).returns(Float) }
def self.cbrt(z); end

sig { params(z: Numeric).returns(Float) }
def self.cos(z); end

sig { params(z: Numeric).returns(Float) }
def self.cosh(z); end

sig { params(z: Numeric).returns(Float) }
def self.exp(z); end

sig { params(z: Numeric, b: Numeric).returns(Float) }
def self.log(z, b = ::Math::E); end

sig { params(z: Numeric).returns(Float) }
def self.log10(z); end

sig { params(z: Numeric).returns(Float) }
def self.log2(z); end

sig { params(z: Numeric).returns(Float) }
def self.sin(z); end

sig { params(z: Numeric).returns(Float) }
def self.sinh(z); end

sig { params(z: Numeric).returns(Float) }
def self.sqrt(z); end

sig { params(z: Numeric).returns(Float) }
def self.tan(z); end

sig { params(z: Numeric).returns(Float) }
def self.tanh(z); end
end
Loading