| 1 |
(* Copyright (C) 2009,2019,2022-2023 Matthew Fluet. |
| 2 |
* Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh |
| 3 |
* Jagannathan, and Stephen Weeks. |
| 4 |
* Copyright (C) 1997-2000 NEC Research Institute. |
| 5 |
* |
| 6 |
* MLton is released under a HPND-style license. |
| 7 |
* See the file MLton-LICENSE for details. |
| 8 |
*) |
| 9 |
|
| 10 |
functor FixReal(PReal: sig include PERVASIVE_REAL end) : REAL = |
| 11 |
struct |
| 12 |
open PReal |
| 13 |
|
| 14 |
(* SML/NJ doesn't support EXACT. *) |
| 15 |
fun fmt f = |
| 16 |
PReal.fmt |
| 17 |
(let |
| 18 |
datatype z = datatype StringCvt.realfmt |
| 19 |
in |
| 20 |
case f of |
| 21 |
EXACT => StringCvt.GEN NONE |
| 22 |
| FIX io => StringCvt.FIX io |
| 23 |
| GEN io => StringCvt.GEN io |
| 24 |
| SCI io => StringCvt.SCI io |
| 25 |
end) |
| 26 |
end |
| 27 |
|
| 28 |
structure Real = FixReal(struct open Pervasive.Real end) |