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

add min and max value for int16 and uint16 #1574

Merged
merged 1 commit into from
Jan 26, 2025
Merged
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
6 changes: 6 additions & 0 deletions int16/int16.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

///|
pub let max_value : Int16 = 32767

///|
pub let min_value : Int16 = -32768

///|
pub fn op_add(self : Int16, that : Int16) -> Int16 {
(self.to_int() + that.to_int()).to_int16()
Expand Down
3 changes: 3 additions & 0 deletions int16/int16.mbti
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package moonbitlang/core/int16

// Values
let max_value : Int16

let min_value : Int16

// Types and methods
impl Int16 {
Expand Down
6 changes: 6 additions & 0 deletions uint16/uint16.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

///|
pub let max_value : UInt16 = 65535

///|
pub let min_value : UInt16 = 0

///|
pub fn op_add(self : UInt16, that : UInt16) -> UInt16 {
(self.to_int() + that.to_int()).to_uint16()
Expand Down
3 changes: 3 additions & 0 deletions uint16/uint16.mbti
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package moonbitlang/core/uint16

// Values
let max_value : UInt16

let min_value : UInt16

// Types and methods
impl UInt16 {
Expand Down
Loading