| u=sizeof(newline); |
u=sizeof(newline); |
| : |
: |
| "newline count ; |
"newline count ; |
| Create "newline 1 c, $0A c, |
Create "newline e? crlf [IF] 2 c, $0D c, [ELSE] 1 c, [THEN] $0A c, |
| |
|
| |
\+os |
| |
|
| utime ( -- dtime ) gforth |
utime ( -- dtime ) gforth |
| ""Report the current time in microseconds since some epoch."" |
""Report the current time in microseconds since some epoch."" |
| dsystem = (DCell)0; |
dsystem = (DCell)0; |
| #endif |
#endif |
| |
|
| |
\+ |
| |
|
| |
\+floating |
| |
|
| v* ( f_addr1 nstride1 f_addr2 nstride2 ucount -- r ) gforth v_star |
v* ( f_addr1 nstride1 f_addr2 nstride2 ucount -- r ) gforth v_star |
| ""dot-product: r=v1*v2. The first element of v1 is at f_addr1, the |
""dot-product: r=v1*v2. The first element of v1 is at f_addr1, the |
| next at f_addr1+nstride1 and so on (similar for v2). Both vectors have |
next at f_addr1+nstride1 and so on (similar for v2). Both vectors have |
| f_addr1 = (Float *)(((Address)f_addr1)+nstride1); |
f_addr1 = (Float *)(((Address)f_addr1)+nstride1); |
| f_addr2 = (Float *)(((Address)f_addr2)+nstride2); |
f_addr2 = (Float *)(((Address)f_addr2)+nstride2); |
| } |
} |
| |
: |
| |
>r swap 2swap swap 0e r> 0 ?DO |
| |
dup f@ over + 2swap dup f@ f* f+ over + 2swap |
| |
LOOP 2drop 2drop ; |
| |
|
| faxpy ( ra f_x nstridex f_y nstridey ucount -- ) gforth |
faxpy ( ra f_x nstridex f_y nstridey ucount -- ) gforth |
| ""vy=ra*vx+vy"" |
""vy=ra*vx+vy"" |
| f_x = (Float *)(((Address)f_x)+nstridex); |
f_x = (Float *)(((Address)f_x)+nstridex); |
| f_y = (Float *)(((Address)f_y)+nstridey); |
f_y = (Float *)(((Address)f_y)+nstridey); |
| } |
} |
| |
: |
| |
>r swap 2swap swap r> 0 ?DO |
| |
fdup dup f@ f* over + 2swap dup f@ f+ dup f! over + 2swap |
| |
LOOP 2drop 2drop fdrop ; |
| |
|
| |
\+ |