00:00:00 --- log: started forth/20.07.09 00:28:24 --- quit: gravicappa (Ping timeout: 272 seconds) 00:39:10 --- quit: xek_ (Ping timeout: 272 seconds) 01:00:18 --- join: gravicappa joined #forth 01:09:28 --- quit: gravicappa (Ping timeout: 256 seconds) 01:23:14 --- join: dys joined #forth 02:12:12 --- quit: proteusguy (Ping timeout: 256 seconds) 02:25:01 --- join: proteusguy joined #forth 02:25:01 --- mode: ChanServ set +v proteusguy 02:40:32 --- join: xek joined #forth 03:03:29 --- join: reepca joined #forth 03:06:06 --- quit: xek (Ping timeout: 272 seconds) 03:18:47 --- quit: reepca (Ping timeout: 258 seconds) 03:24:11 --- join: reepca joined #forth 03:27:55 --- quit: reepca (Read error: Connection reset by peer) 03:45:43 --- join: xek joined #forth 03:50:19 --- join: TCZ joined #forth 04:08:57 --- join: gravicappa joined #forth 04:25:34 Why do we go to the trouble to handle zero at all? Logarithms of zero aren't defined. 04:38:37 --- quit: dave0 (Quit: dave's not here) 05:15:18 --- quit: xek (Ping timeout: 272 seconds) 05:23:32 --- quit: TCZ (Quit: Leaving) 06:14:21 --- quit: Zarutian_HTC (Ping timeout: 258 seconds) 06:17:48 --- join: xek joined #forth 06:23:37 --- join: TCZ joined #forth 06:44:24 --- join: rdrop-exit joined #forth 06:46:32 It's just in certain cases 06:47:26 it's just convenient in certain cases 06:49:01 you can save one Forth instruction on clog2 if you prefer to ignore it 06:49:20 it makes no difference in the floored log2 06:56:27 Here's a version of ceiling log2 without the artificial value at 0: 06:57:01 : clog2 ( u -- u' ) #lead-0s 65 \- ;inline 06:58:21 oops that's totally wrong 06:59:25 better stick with the original: 06:59:26 : clog2 ( u -- u' ) dup 0<> + #lead-0s 64 \- ;inline 07:03:19 feel free to ignore the pseudo values at 0 if you have no use for them 07:03:53 --- quit: TCZ (Quit: Leaving) 07:04:18 The floored version is also fine as it is: 07:04:20 : log2 ( u -- n ) #lead-0s 63 \- ;inline 07:08:00 2 2** Raise 2 to a power. 07:08:00 3 07:08:00 4 pwr2 Floor power of 2, round down to closest power of 2 07:08:00 5 <= . 07:08:00 6 07:08:02 7 cpwr2 Ceiling power of 2, round up to the closest power of 2 07:08:05 8 >= . 07:08:44 0 source Arithmetic - Powers of 2 07:08:44 1 07:08:44 2 : 2** ( 0..3f -- 1<<0..3f ) 1 swap lshift ;inline 07:08:44 3 07:08:44 4 : pwr2 ( u -- u' ) log2 2** ;inline 07:08:46 5 07:08:49 6 : cpwr2 ( u -- u' ) clog2 2** ;inline 07:09:11 7 07:09:12 b 07:09:13 c addressing Number of address bits needed to address a memory of 07:09:13 d size . 07:09:16 e 07:09:26 c : addressing ( u -- #bits ) clog2 ;inline 07:09:27 d 07:15:38 #bits Number of significant bits of . 07:15:53 : #bits ( u -- # ) log2 0 max 1+ ;inline 07:16:06 #bytes Number of significant bytes of , i.e. radix 256. 07:16:15 : #bytes ( u -- # ) log2 0 max 3 rshift 1+ ;inline 07:26:18 #decimals Number of significant decimal digits of . 07:26:30 : #decimals ( u -- # ) lg 0 max 1+ ;inline 07:28:09 The definition of #decimals above makes the same assumption about the common logarithm being "pseudo" defined as -1 at zero 07:36:36 good night Forthwrights 07:36:42 --- quit: rdrop-exit (Quit: Lost terminal) 08:37:07 --- join: Zarutian_HTC joined #forth 08:58:16 --- quit: gravicappa (Ping timeout: 240 seconds) 09:15:50 --- join: proteus-guy joined #forth 09:48:37 --- quit: ovf (Disconnected by services) 09:50:02 --- join: ovf_ joined #forth 09:55:49 --- quit: Blue_flame (*.net *.split) 09:55:49 --- quit: jimt[m] (*.net *.split) 09:56:51 --- quit: dys (Ping timeout: 244 seconds) 09:57:18 --- quit: siraben (Write error: Connection reset by peer) 10:00:48 --- join: siraben joined #forth 10:09:04 --- join: jimt[m] joined #forth 10:09:04 --- join: Blue_flame joined #forth 11:54:47 --- join: TCZ joined #forth 11:58:11 --- quit: xek (Ping timeout: 246 seconds) 12:02:57 --- join: gravicappa joined #forth 12:19:16 --- quit: Zarutian_HTC (Ping timeout: 256 seconds) 13:08:19 --- join: xek joined #forth 13:33:45 --- join: dave0 joined #forth 13:37:14 --- quit: xek (Ping timeout: 246 seconds) 13:47:03 --- join: X-Scale` joined #forth 13:47:59 --- quit: X-Scale (Ping timeout: 264 seconds) 13:48:00 --- nick: X-Scale` -> X-Scale 14:25:49 --- quit: TCZ (Quit: Leaving) 14:27:38 --- quit: gravicappa (Ping timeout: 246 seconds) 14:52:00 --- join: X-Scale` joined #forth 14:52:50 --- quit: X-Scale (Ping timeout: 246 seconds) 14:52:51 --- nick: X-Scale` -> X-Scale 15:03:56 --- join: lchvdlch joined #forth 15:04:33 --- part: lchvdlch left #forth 17:34:11 --- log: started forth/20.07.09 17:34:11 --- join: clog joined #forth 17:34:11 --- topic: 'Forth Programming | logged by clog at http://bit.ly/91toWN backup at http://forthworks.com/forth/irc-logs/ | If you have two (or more) stacks and speak RPN then you're welcome here! | https://github.com/mark4th' 17:34:11 --- topic: set by proteusguy!~proteusgu@cm-58-10-208-146.revip7.asianet.co.th on [Mon Dec 30 10:43:28 2019] 17:34:11 --- names: list (clog Zarutian_HTC TCZ WickedShell X-Scale dave0 Blue_flame jimt[m] siraben ovf_ proteus-guy +proteusguy Lord_Nightmare Keshl boru phadthai rann mjl guan jhei pointfree arrdem deesix dddddd DKordic _whitelogger catern iyzsong jedb jackdaniel MrMobius spoofer cp- tabemann cmtptr lonjil patrickg Vedran cantstanya WilhelmVonWeiner Croran neuro_sys djinni APic nmz a3f routeveg presiden tangentstorm kvik ornxka_ tolja irsol elioat Kumool koisoke pareidolia bluekelp) 17:34:11 --- names: list (heredoc +crc Chobbes klys rpcope +KipIngram jn__ yunfan crest ecraven veltas diginet2 fiddlerwoaroof rprimus C-Keen dzho) 17:57:39 --- quit: TCZ (Quit: Leaving) 18:27:52 --- join: boru` joined #forth 18:27:55 --- quit: boru (Disconnected by services) 18:27:57 --- nick: boru` -> boru 19:01:37 --- join: Rakko joined #forth 19:30:44 --- quit: WickedShell (Remote host closed the connection) 19:55:38 --- quit: Zarutian_HTC (Ping timeout: 272 seconds) 20:48:01 --- join: Zarutian_HTC joined #forth 21:09:01 --- quit: jimt[m] (*.net *.split) 21:09:01 --- quit: Blue_flame (*.net *.split) 21:09:02 --- quit: proteusguy (*.net *.split) 21:09:02 --- quit: DKordic (*.net *.split) 21:09:03 --- quit: lonjil (*.net *.split) 21:09:03 --- quit: patrickg (*.net *.split) 21:09:03 --- quit: Vedran (*.net *.split) 21:09:03 --- quit: veltas (*.net *.split) 21:09:03 --- quit: diginet2 (*.net *.split) 21:09:03 --- quit: fiddlerwoaroof (*.net *.split) 21:12:18 --- quit: proteus-guy (*.net *.split) 21:12:18 --- quit: jhei (*.net *.split) 21:12:18 --- quit: KipIngram (*.net *.split) 21:12:18 --- quit: jn__ (*.net *.split) 21:12:18 --- quit: yunfan (*.net *.split) 21:12:18 --- quit: crest (*.net *.split) 21:12:18 --- quit: ecraven (*.net *.split) 21:12:18 --- quit: Zarutian_HTC (*.net *.split) 21:12:18 --- quit: crc (*.net *.split) 21:12:18 --- quit: Chobbes (*.net *.split) 21:12:18 --- quit: klys (*.net *.split) 21:12:18 --- quit: rpcope (*.net *.split) 21:12:18 --- quit: heredoc (*.net *.split) 21:12:18 --- quit: MrMobius (*.net *.split) 21:12:18 --- quit: cp- (*.net *.split) 21:12:18 --- quit: bluekelp (*.net *.split) 21:12:18 --- quit: Lord_Nightmare (*.net *.split) 21:12:18 --- quit: spoofer (*.net *.split) 21:12:18 --- quit: elioat (*.net *.split) 21:12:18 --- quit: Kumool (*.net *.split) 21:12:18 --- quit: koisoke (*.net *.split) 21:12:18 --- quit: irsol (*.net *.split) 21:12:18 --- quit: phadthai (*.net *.split) 21:12:18 --- quit: kvik (*.net *.split) 21:12:18 --- quit: ornxka_ (*.net *.split) 21:12:18 --- quit: tolja (*.net *.split) 21:12:18 --- quit: presiden (*.net *.split) 21:12:18 --- quit: tangentstorm (*.net *.split) 21:12:18 --- quit: arrdem (*.net *.split) 21:12:18 --- quit: _whitelogger (*.net *.split) 21:12:18 --- quit: nmz (*.net *.split) 21:12:18 --- quit: a3f (*.net *.split) 21:12:18 --- quit: routeveg (*.net *.split) 21:12:18 --- quit: pointfree (*.net *.split) 21:12:18 --- quit: deesix (*.net *.split) 21:12:18 --- quit: dddddd (*.net *.split) 21:12:18 --- quit: catern (*.net *.split) 21:12:18 --- quit: APic (*.net *.split) 21:12:18 --- quit: boru (*.net *.split) 21:12:18 --- quit: neuro_sys (*.net *.split) 21:12:18 --- quit: djinni (*.net *.split) 21:12:18 --- quit: ovf_ (*.net *.split) 21:12:18 --- quit: guan (*.net *.split) 21:12:18 --- quit: Croran (*.net *.split) 21:12:18 --- quit: siraben (*.net *.split) 21:12:18 --- quit: tabemann (*.net *.split) 21:12:18 --- quit: pareidolia (*.net *.split) 21:12:18 --- quit: WilhelmVonWeiner (*.net *.split) 21:12:18 --- quit: cantstanya (*.net *.split) 21:12:18 --- quit: rann (*.net *.split) 21:12:18 --- quit: mjl (*.net *.split) 21:12:18 --- quit: iyzsong (*.net *.split) 21:12:18 --- quit: Rakko (Quit: Leaving) 21:14:23 --- quit: X-Scale (Ping timeout: 264 seconds) 21:15:02 --- join: koisoke joined #forth 21:15:02 --- join: Kumool joined #forth 21:15:02 --- join: elioat joined #forth 21:15:02 --- join: spoofer joined #forth 21:15:02 --- join: Lord_Nightmare joined #forth 21:15:02 --- join: irsol joined #forth 21:15:02 --- join: proteus-guy joined #forth 21:15:02 --- join: ecraven joined #forth 21:15:02 --- join: crest joined #forth 21:15:02 --- join: yunfan joined #forth 21:15:02 --- join: jn__ joined #forth 21:15:02 --- join: KipIngram joined #forth 21:15:02 --- join: jhei joined #forth 21:15:02 --- join: fiddlerwoaroof joined #forth 21:15:02 --- join: diginet2 joined #forth 21:15:02 --- join: veltas joined #forth 21:15:02 --- join: Vedran joined #forth 21:15:02 --- join: patrickg joined #forth 21:15:02 --- join: lonjil joined #forth 21:15:02 --- join: DKordic joined #forth 21:15:02 --- join: proteusguy joined #forth 21:15:02 --- join: jimt[m] joined #forth 21:15:02 --- join: Blue_flame joined #forth 21:15:02 --- join: tolja joined #forth 21:15:02 --- join: ornxka_ joined #forth 21:15:02 --- join: kvik joined #forth 21:15:02 --- join: phadthai joined #forth 21:15:02 --- join: routeveg joined #forth 21:15:02 --- join: a3f joined #forth 21:15:02 --- join: nmz joined #forth 21:15:02 --- join: arrdem joined #forth 21:15:02 --- join: tangentstorm joined #forth 21:15:02 --- join: presiden joined #forth 21:15:02 --- join: rpcope joined #forth 21:15:02 --- join: klys joined #forth 21:15:02 --- join: Chobbes joined #forth 21:15:02 --- join: crc joined #forth 21:15:02 --- join: Zarutian_HTC joined #forth 21:15:02 --- join: heredoc joined #forth 21:15:02 --- join: bluekelp joined #forth 21:15:02 --- join: cp- joined #forth 21:15:02 --- join: MrMobius joined #forth 21:15:02 --- join: APic joined #forth 21:15:02 --- join: catern joined #forth 21:15:02 --- join: dddddd joined #forth 21:15:02 --- join: deesix joined #forth 21:15:02 --- mode: verne.freenode.net set +vvv KipIngram proteusguy crc 21:15:02 --- join: pointfree joined #forth 21:15:02 --- join: boru joined #forth 21:15:02 --- join: mjl joined #forth 21:15:02 --- join: guan joined #forth 21:15:02 --- join: iyzsong joined #forth 21:15:02 --- join: tabemann joined #forth 21:15:02 --- join: pareidolia joined #forth 21:15:02 --- join: djinni joined #forth 21:15:02 --- join: neuro_sys joined #forth 21:15:02 --- join: Croran joined #forth 21:15:02 --- join: WilhelmVonWeiner joined #forth 21:15:02 --- join: cantstanya joined #forth 21:17:13 --- quit: jimt[m] (Ping timeout: 246 seconds) 21:17:13 --- join: _whitelogger joined #forth 21:17:13 --- quit: Blue_flame (Ping timeout: 246 seconds) 21:17:13 --- join: X-Scale joined #forth 21:18:23 --- join: rann joined #forth 21:18:30 --- join: ovf joined #forth 21:18:48 --- quit: ovf (Excess Flood) 21:20:42 --- join: Blue_flame joined #forth 21:20:45 --- join: ovf joined #forth 21:28:38 --- join: jimt[m] joined #forth 21:28:38 --- join: siraben joined #forth 21:40:24 --- join: gravicappa joined #forth 22:42:24 --- quit: _whitelogger (Remote host closed the connection) 22:45:24 --- join: _whitelogger joined #forth 22:47:32 --- join: jedb_ joined #forth 22:49:49 --- quit: gravicappa (Ping timeout: 240 seconds) 22:50:23 --- quit: jedb (Ping timeout: 264 seconds) 22:52:39 --- join: gravicappa joined #forth 23:47:52 --- join: xek joined #forth 23:59:59 --- log: ended forth/20.07.09