00:00:00 --- log: started forth/20.12.30 00:59:59 --- join: irsol joined #forth 01:20:16 TangentDelta, that's a fascinating chip. Wonder if it was mentioned in Koopman's stack machine book. 01:43:11 --- join: dave0 joined #forth 03:40:43 --- quit: birdwing (Ping timeout: 272 seconds) 04:27:15 --- join: Gromboli joined #forth 05:34:27 --- join: birdwing joined #forth 06:39:35 --- quit: tabemann_ (Remote host closed the connection) 06:39:49 --- join: tabemann_ joined #forth 08:51:45 --- quit: cantstanya (Ping timeout: 240 seconds) 08:55:18 --- join: cantstanya joined #forth 09:16:32 --- quit: dave0 (Quit: dave's not here) 09:51:06 --- quit: iyzsong (Quit: ZNC 1.7.5 - https://znc.in) 09:51:35 --- join: iyzsong joined #forth 09:53:18 --- quit: gravicappa (Ping timeout: 240 seconds) 09:56:15 --- join: gravicappa joined #forth 10:25:25 --- join: inode joined #forth 10:33:39 --- quit: birdwing (Ping timeout: 272 seconds) 10:39:00 --- quit: inode (Quit: ) 12:17:46 --- join: badcfe joined #forth 12:18:54 i would like to do in forth as in c when (unsigned)i, which is like a re-interpret-cast as in c++ 12:21:29 hmm. i see i must rephrase the problem. teh context is that i want to do as in forth 32768 mod but considering the number on the stack as if it was re-interpreted as unsigned regarding the semantics of the msb 12:23:56 looking at the behavior of mod, it seems i'll merely 1+ when i have a negative number 12:24:32 and bitwize not it 12:25:19 something like that, manually. unless there is something more efficient 12:27:23 badcfe, what are you trying to do exactly? 12:27:32 rather, s>d but without sign-extending it 12:27:32 there is u> for example to compare 12:28:09 MrMobius: exactly? .. as in C the following (unsigned(rnd_next/65536) % 32768) / 32768.0 12:28:38 MrMobius: it is part of the pseudo random example on my rand 2 man 12:28:56 MrMobius: practicing forth here 12:29:56 MrMobius: rnd_next is unsigned 12:30:03 you could AND with 0x3FFF to do mod 32768 12:30:52 yes. but for the following f division i must consider it s>d without sign-extending it 12:30:58 youre trying to generate a random float between 0.0 and 1.0? 12:31:03 yes. 12:31:27 but i found this problem interesting by itself. as i am learning forth 12:31:46 could i s>d without sign-extending prior to the f/ ? 12:32:27 that is, as part of the s>d d>f that i would need 12:32:49 the AND with 0x3FFF is excelent 12:33:20 maybe i could shift the bits down, prior to s>d and then shift up again? 12:33:36 that's what i could do instead of the AND there, in that case 12:35:00 that, is if rshift is not "arithmetic" then i"m good to go 12:36:39 doing -1 1 rshift, i see it's nice, but not sure if this is well defined behavior 12:37:49 15 rshift s>d 15 2lshift 12:38:30 heh, how do i lshift a double word number? 12:39:29 s>d is sign-extending 12:39:53 in my case i can use a simple lshift tho. i'm good 12:58:56 --- quit: gravicappa (Ping timeout: 256 seconds) 13:38:07 : rnd rndn dup @ 1103515245 * 12345 + dup rot ! 65536 / 14 rshift s>d 14 lshift d>f 32768e f/ ; 13:38:48 create rndn 1 , 13:39:15 MrMobius: but when i call rnd i get numbers above 1 13:46:09 oh, i see it. i must lshift the one below the top 0 added by s>d, not the 0 13:47:06 MrMobius: but is the order of s>d defined? 13:47:37 MrMobius: does forth define the order of msb lsb on the stack for a double word number? 13:48:49 it seems i will merely 0 instead of s>d and i can just and like suggested anyway 13:54:59 --- quit: Gromboli (Quit: Leaving) 14:02:48 correction MrMobius "you could AND with 0x3FFF to do mod 32768" should have been "you could AND with 0x7FFF to do mod 32768" 14:02:55 MrMobius: ^ 14:18:50 badcfe, sorry, got busy 14:19:30 not sure about order. you can just do a little check and see how your forth does it 14:20:05 there is the ANS standard for example but a lot of people make their own forth or use one someone else made, so a forth could be doing anything 14:20:26 ya 0x7FFF sorry 14:36:32 no problem. and thank you ! 14:46:38 trying to write another nice function here 14:46:39 : linear ( n i FP b a -- FP i*{b-a}/n+a ) fdup frot frot f- s>f f* s>f f/ f+ ; 14:46:46 any comments on the "style" here? 17:32:44 --- join: dave0 joined #forth 18:00:42 --- quit: dave0 (Quit: dave's not here) 18:26:30 can i construct a string in a function, and return its address? 18:26:48 (without placing a name in dictionary) 18:29:20 Depends on the flavor of FORTH used 18:30:12 I keep meaning to read through this article https://ia801008.us.archive.org/19/items/dr_dobbs_journal_vol_05_201803/dr_dobbs_journal_vol_05.pdf#page=448 18:38:11 hey guys 18:44:50 --- join: boru` joined #forth 18:44:52 --- quit: boru (Disconnected by services) 18:44:55 --- nick: boru` -> boru 19:38:59 i would like to take the address of the data stack top 19:39:23 this is because i have a loop that places stuff on the stack, and i would to know the count after the loop was done 19:40:03 is there a word for this? 19:41:17 i was trying to count with 0 >r begin ... while r> 1+ >r repeat r> 20:16:34 but now i rewrote it, managing to only use data stack, but it behaves weird and i dont manage to reproduce by interpreting step by step 20:16:37 : ad ( n -- D c ) 0 swap begin 10 /mod while rot 1+ swap repeat ; 20:18:05 i expected 12345 ad to give me 5 4 3 2 4 1 0 or maybe without that last zero. but what i get is an underflow on rot there 20:18:58 oh i think, as the newb i am, i forgot that while consumes the top 20:19:20 --- quit: sts-q (Ping timeout: 246 seconds) 20:22:26 that works, but now i see that i could just have used a marker-value on the stack before starting the loop 20:22:41 and then unwrapping it 20:34:45 --- join: sts-q joined #forth 20:47:04 i think i have it all sorted out now ... 20:47:18 ... as long as there is a way to output raw data to stdout 20:47:34 like a binary type, is there? 20:49:34 hmm, i can use emit 21:06:11 or, can i type it? 21:28:52 seems i can. good 22:14:56 --- quit: badcfe (Quit: leaving) 22:32:58 --- join: gravicappa joined #forth 23:07:26 --- join: birdwing joined #forth 23:12:24 --- quit: _whitelogger (Remote host closed the connection) 23:15:20 --- join: _whitelogger joined #forth 23:16:24 --- quit: birdwing (Read error: Connection reset by peer) 23:59:59 --- log: ended forth/20.12.30