Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit94c637d

Browse files
committed
Add signed integer type (sint)
1 parent47fbd06 commit94c637d

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)

[8]ページ先頭

©2009-2025 Movatter.jp