Skip to content

Commit

Permalink
fix int to int64 conversion and vice versa (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
fatmage authored Nov 22, 2024
1 parent 556a62c commit f54c429
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Base/Int.fram
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import open Types
import open Operators

pub method toString = (extern dbl_intToString : Int -> String) self
pub method toInt64 = (extern dbl_int64ToInt : Int -> Int64) self
pub method toInt64 = (extern dbl_intToInt64 : Int -> Int64) self

pub method equal = (extern dbl_eqInt : Int -> Int -> Bool) self
pub method neq = (extern dbl_neqInt : Int -> Int -> Bool) self
Expand Down
4 changes: 2 additions & 2 deletions lib/Base/Int64.fram
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ pub method toString {self : Int64} =
(extern dbl_int64ToString : Int64 -> String) self
pub method toInt {~re : {type X} -> Unit ->[|_] X, self : Int64} =
if self <= 0x3fffffffffffffffL && self >= 0xc000000000000000L then
(extern dbl_intToInt64 : Int64 -> Int) self
(extern dbl_int64ToInt : Int64 -> Int) self
else ~re ()
pub method toIntOpt {self : Int64} =
if self <= 0x3fffffffffffffffL && self >= 0x7fffffffffffffffL then
Some ((extern dbl_intToInt64 : Int64 -> Int) self)
Some ((extern dbl_int64ToInt : Int64 -> Int) self)
else None

pub method abs {self : Int64} =
Expand Down

0 comments on commit f54c429

Please sign in to comment.