Skip to content

Commit 0d06e7f

Browse files
authored
Merge pull request #8 from jakobj/feat/sint
Looks good.
2 parents 47fbd06 + 94c637d commit 0d06e7f

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

math/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616
#
1717
#-------------------------------------------------------------------------
18-
TARGETACT=_all_.act fxp.act misc.act
18+
TARGETACT=_all_.act fxp.act misc.act sint.act
1919
TARGETACTSUBDIR=math
2020

2121
include $(ACT_HOME)/scripts/Makefile.std

math/_all_.act

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@
2121

2222
import "math/fxp.act";
2323
import "math/misc.act";
24+
import "math/sint.act";

math/sint.act

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
namespace math {
2+
export
3+
template<pint W>
4+
deftype sint <: fixpoint<W,0> ()
5+
{
6+
methods {
7+
function positive() : bool {
8+
chp {
9+
self := fxp::positive<W,0>(x)
10+
}
11+
}
12+
}
13+
}
14+
15+
export
16+
namespace sint_ops {
17+
template<pint W,N>
18+
function clsl(sint<W> v) : sint<W> {
19+
chp {
20+
self.x := v.x << N
21+
}
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)