Skip to content

Commit

Permalink
Add IEEE_REAL signature
Browse files Browse the repository at this point in the history
  • Loading branch information
minoki committed Jul 25, 2023
1 parent 47bd9d7 commit 03eb5ce
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 43 deletions.
3 changes: 2 additions & 1 deletion doc/BasisLibrary.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ structure LargeWord = Word64
## structure IEEEReal - partial

```sml
structure IEEEReal : sig
signature IEEE_REAL = sig
exception Unordered
datatype real_order = LESS | EQUAL | GREATER | UNORDERED
datatype float_class = NAN | INF | ZERO | NORMAL | SUBNORMAL
Expand All @@ -282,6 +282,7 @@ structure IEEEReal : sig
(* val scan : (char, 'a) StringCvt.reader -> (decimal_approx, 'a) StringCvt.reader *)
(* val fromString : string -> decimal_approx option *)
end
structure IEEEReal : IEEE_REAL
```

## signature REAL (structure Real, structure LargeReal) - partial
Expand Down
2 changes: 2 additions & 0 deletions lib/lunarml/ml/basis/basis-js-common.mlb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ $(TARGET_LANG)/string-prim.sml
$(TARGET_LANG)/array-prim.sml (* depends on int, Unsafe, Subscript, List.tabulate *)
math-sig.sml
string-cvt-sig.sml
ieee-real.sml
js-common/mlbasis.sml
vector-sig.sml
array.sml
Expand Down Expand Up @@ -57,6 +58,7 @@ signature BOOL
signature BYTE
signature CHAR
signature DATE
signature IEEE_REAL
signature INTEGER
signature INT_INF
signature LIST
Expand Down
2 changes: 2 additions & 0 deletions lib/lunarml/ml/basis/basis-lua.mlb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ bool.sml
$(TARGET_LANG)/array-prim.sml
math-sig.sml
string-cvt-sig.sml
ieee-real.sml
lua/mlbasis.sml
vector-sig.sml
array.sml
Expand Down Expand Up @@ -57,6 +58,7 @@ signature BOOL
signature BYTE
signature CHAR
signature DATE
signature IEEE_REAL
signature INTEGER
signature INT_INF
signature LIST
Expand Down
2 changes: 2 additions & 0 deletions lib/lunarml/ml/basis/basis-luajit.mlb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ bool.sml
$(TARGET_LANG)/array-prim.sml
math-sig.sml
string-cvt-sig.sml
ieee-real.sml
luajit/mlbasis.sml
vector-sig.sml
array.sml
Expand Down Expand Up @@ -59,6 +60,7 @@ signature BOOL
signature BYTE
signature CHAR
signature DATE
signature IEEE_REAL
signature INTEGER
signature INT_INF
signature LIST
Expand Down
14 changes: 14 additions & 0 deletions lib/lunarml/ml/basis/ieee-real.sml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
signature IEEE_REAL = sig
exception Unordered
datatype real_order = LESS | EQUAL | GREATER | UNORDERED
datatype float_class = NAN | INF | ZERO | NORMAL | SUBNORMAL
datatype rounding_mode = TO_NEAREST | TO_NEGINF | TO_POSINF | TO_ZERO
type decimal_approx = { class : float_class, sign : bool, digits : int list, exp : int }
end
structure IEEEReal : IEEE_REAL = struct
exception Unordered
datatype real_order = LESS | EQUAL | GREATER | UNORDERED
datatype float_class = NAN | INF | ZERO | NORMAL | SUBNORMAL
datatype rounding_mode = TO_NEAREST | TO_NEGINF | TO_POSINF | TO_ZERO
type decimal_approx = { class : float_class, sign : bool, digits : int list, exp : int }
end;
14 changes: 0 additions & 14 deletions lib/lunarml/ml/basis/js-common/mlbasis.sml
Original file line number Diff line number Diff line change
Expand Up @@ -288,20 +288,6 @@ fun toString (x : word) : string = fmt StringCvt.HEX x
(* scan, fromString *)
end; (* structure Word *)

structure IEEEReal : sig
exception Unordered
datatype real_order = LESS | EQUAL | GREATER | UNORDERED
datatype float_class = NAN | INF | ZERO | NORMAL | SUBNORMAL
datatype rounding_mode = TO_NEAREST | TO_NEGINF | TO_POSINF | TO_ZERO
type decimal_approx = { class : float_class, sign : bool, digits : int list, exp : int }
end = struct
exception Unordered
datatype real_order = LESS | EQUAL | GREATER | UNORDERED
datatype float_class = NAN | INF | ZERO | NORMAL | SUBNORMAL
datatype rounding_mode = TO_NEAREST | TO_NEGINF | TO_POSINF | TO_ZERO
type decimal_approx = { class : float_class, sign : bool, digits : int list, exp : int }
end;

signature REAL = sig
type real
(* structure Math *)
Expand Down
14 changes: 0 additions & 14 deletions lib/lunarml/ml/basis/lua/mlbasis.sml
Original file line number Diff line number Diff line change
Expand Up @@ -578,20 +578,6 @@ val toString : word -> string = fn x => Lua.unsafeFromValue (Lua.call1 Lua.Lib.s
(* scan, fromString *)
end; (* structure Word *)

structure IEEEReal : sig
exception Unordered
datatype real_order = LESS | EQUAL | GREATER | UNORDERED
datatype float_class = NAN | INF | ZERO | NORMAL | SUBNORMAL
datatype rounding_mode = TO_NEAREST | TO_NEGINF | TO_POSINF | TO_ZERO
type decimal_approx = { class : float_class, sign : bool, digits : int list, exp : int }
end = struct
exception Unordered
datatype real_order = LESS | EQUAL | GREATER | UNORDERED
datatype float_class = NAN | INF | ZERO | NORMAL | SUBNORMAL
datatype rounding_mode = TO_NEAREST | TO_NEGINF | TO_POSINF | TO_ZERO
type decimal_approx = { class : float_class, sign : bool, digits : int list, exp : int }
end;

signature REAL = sig
type real
(* structure Math *)
Expand Down
14 changes: 0 additions & 14 deletions lib/lunarml/ml/basis/luajit/mlbasis.sml
Original file line number Diff line number Diff line change
Expand Up @@ -277,20 +277,6 @@ val toString : word -> string = fn x => Lua.unsafeFromValue (Lua.call1 Lua.Lib.s
(* scan, fromString *)
end; (* structure Word *)

structure IEEEReal : sig
exception Unordered
datatype real_order = LESS | EQUAL | GREATER | UNORDERED
datatype float_class = NAN | INF | ZERO | NORMAL | SUBNORMAL
datatype rounding_mode = TO_NEAREST | TO_NEGINF | TO_POSINF | TO_ZERO
type decimal_approx = { class : float_class, sign : bool, digits : int list, exp : int }
end = struct
exception Unordered
datatype real_order = LESS | EQUAL | GREATER | UNORDERED
datatype float_class = NAN | INF | ZERO | NORMAL | SUBNORMAL
datatype rounding_mode = TO_NEAREST | TO_NEGINF | TO_POSINF | TO_ZERO
type decimal_approx = { class : float_class, sign : bool, digits : int list, exp : int }
end;

signature REAL = sig
type real
(* structure Math *)
Expand Down

0 comments on commit 03eb5ce

Please sign in to comment.