Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #400968 > unrolled thread

why is there not a ipow version of pow?

Started byLynn McGuire <lynnmcguire5@gmail.com>
First post2026-08-11 03:01 -0500
Last post2026-08-18 11:32 +0200
Articles 20 on this page of 190 — 17 participants

Back to article view | Back to comp.lang.c


Contents

  why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-11 03:01 -0500
    Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-11 13:11 +0200
      Re: why is there not a ipow version of pow? bart <bc@freeuk.com> - 2026-08-11 12:45 +0100
        Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-11 14:34 +0200
        Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-11 14:55 +0200
          Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-11 15:19 +0200
            Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-11 15:27 +0200
              Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-11 16:08 +0200
                Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-11 16:18 +0200
                  Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-11 17:11 +0200
                    Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-11 17:20 +0200
                      Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-11 17:32 +0200
                        Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-11 17:39 +0200
                          Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-11 18:33 +0200
                            Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-11 18:39 +0200
                            Re: why is there not a ipow version of pow? Michael S <already5chosen@yahoo.com> - 2026-08-11 23:31 +0300
                        Re: why is there not a ipow version of pow? James Kuyper <jameskuyper@alumni.caltech.edu> - 2026-08-11 11:46 -0400
                          Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-11 18:35 +0200
                        Re: why is there not a ipow version of pow? antispam@fricas.org (Waldek Hebisch) - 2026-08-11 22:53 +0000
                          Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-12 10:08 +0200
                            Re: why is there not a ipow version of pow? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-12 03:58 -0700
                              Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-12 13:31 +0200
                              Re: why is there not a ipow version of pow? Michael S <already5chosen@yahoo.com> - 2026-08-12 22:43 +0300
                                Re: why is there not a ipow version of pow? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-12 13:44 -0700
                                  Re: why is there not a ipow version of pow? Michael S <already5chosen@yahoo.com> - 2026-08-13 00:24 +0300
                                    Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-12 16:49 -0500
                                      Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-13 08:38 +0200
                                        Re: Calculation of sine with tables (was Re: why is there not a ipow version of pow?) scott@slp53.sl.home (Scott Lurndal) - 2026-08-13 14:36 +0000
                                        Re: Calculation of sine with tables (was Re: why is there not a ipow version of pow?) David Brown <david.brown@hesbynett.no> - 2026-08-13 17:07 +0200
                                          Re: Calculation of sine with tables (was Re: why is there not a ipow version of pow?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-08-13 19:07 +0200
                                            Re: Calculation of sine with tables (was Re: why is there not a ipow version of pow?) David Brown <david.brown@hesbynett.no> - 2026-08-13 22:24 +0200
                                              Re: Calculation of sine with tables (was Re: why is there not a ipow version of pow?) Ross Finlayson <ross.a.finlayson@gmail.com> - 2026-08-13 16:36 -0700
                                        Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-13 18:59 -0500
                                          Re: why is there not a ipow version of pow? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-13 18:51 -0700
                                            Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-14 00:58 -0500
                                              Re: why is there not a ipow version of pow? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-14 12:08 -0700
                                                Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-14 15:48 -0500
                                                  Re: why is there not a ipow version of pow? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-14 13:51 -0700
                                                    Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-14 16:40 -0500
                                                      Re: why is there not a ipow version of pow? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-14 19:24 -0700
                                                        Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-14 22:51 -0500
                                                          Re: why is there not a ipow version of pow? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-14 22:33 -0700
                                                          Re: why is there not a ipow version of pow? Ross Finlayson <ross.a.finlayson@gmail.com> - 2026-08-15 10:40 -0700
                                                            Re: why is there not a ipow version of pow? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-15 11:41 -0700
                                                            Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-17 14:48 -0500
                                                      Re: why is there not a ipow version of pow? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-16 14:58 -0700
                                          Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-14 08:57 +0200
                                            Re: why is there not a ipow version of pow? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-14 12:46 -0700
                                        Calculation of sine with tables (was Re: why is there not a ipow version of pow?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-08-13 14:45 +0200
                                      Re: why is there not a ipow version of pow? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-08-15 13:00 -0700
                                        Re: why is there not a ipow version of pow? Michael S <already5chosen@yahoo.com> - 2026-08-15 23:17 +0300
                                          Re: why is there not a ipow version of pow? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-08-17 10:07 -0700
                                            Re: why is there not a ipow version of pow? Michael S <already5chosen@yahoo.com> - 2026-08-18 00:35 +0300
                                              Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-18 11:22 +0200
                                                Re: why is there not a ipow version of pow? Michael S <already5chosen@yahoo.com> - 2026-08-18 22:22 +0300
                                                  Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-18 21:59 +0200
                                              Re: why is there not a ipow version of pow? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-08-18 08:38 -0700
                                                Re: why is there not a ipow version of pow? Michael S <already5chosen@yahoo.com> - 2026-08-18 22:17 +0300
                                                  Re: why is there not a ipow version of pow? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-08-18 15:42 -0700
                                                    Re: why is there not a ipow version of pow? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-08-18 17:44 -0700
                                                    Re: why is there not a ipow version of pow? Michael S <already5chosen@yahoo.com> - 2026-08-19 21:55 +0300
                                                      Re: why is there not a ipow version of pow? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-08-19 18:25 -0700
                                                Re: why is there not a ipow version of pow? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-19 04:53 +0800
                                  Re: why is there not a ipow version of pow? James Kuyper <jameskuyper@alumni.caltech.edu> - 2026-08-13 12:59 -0400
                            Re: why is there not a ipow version of pow? antispam@fricas.org (Waldek Hebisch) - 2026-08-12 20:23 +0000
                      Re: why is there not a ipow version of pow? scott@slp53.sl.home (Scott Lurndal) - 2026-08-11 18:19 +0000
                        Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-11 20:21 +0200
                          Re: why is there not a ipow version of pow? scott@slp53.sl.home (Scott Lurndal) - 2026-08-11 21:10 +0000
                            Re: why is there not a ipow version of pow? Michael S <already5chosen@yahoo.com> - 2026-08-12 00:42 +0300
                            Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-12 06:41 +0200
                              Re: why is there not a ipow version of pow? scott@slp53.sl.home (Scott Lurndal) - 2026-08-12 14:19 +0000
                                Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-12 16:56 +0200
                                  Re: why is there not a ipow version of pow? scott@slp53.sl.home (Scott Lurndal) - 2026-08-12 15:32 +0000
                              Re: why is there not a ipow version of pow? Michael S <already5chosen@yahoo.com> - 2026-08-12 22:05 +0300
                                Re: why is there not a ipow version of pow? Paul <nospam@needed.invalid> - 2026-08-12 19:09 -0400
                      Re: why is there not a ipow version of pow? Michael S <already5chosen@yahoo.com> - 2026-08-11 21:58 +0300
                  Re: why is there not a ipow version of pow? Ross Finlayson <ross.a.finlayson@gmail.com> - 2026-08-11 21:44 -0700
                Re: why is there not a ipow version of pow? bart <bc@freeuk.com> - 2026-08-11 15:45 +0100
                  Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-11 16:56 +0200
                    Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-11 17:23 +0200
                      Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-11 17:24 +0200
                    Re: why is there not a ipow version of pow? bart <bc@freeuk.com> - 2026-08-11 16:23 +0100
                      Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-11 17:26 +0200
                      Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-11 17:54 +0200
                      Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-11 18:40 +0200
                        Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-12 08:49 +0200
                          Re: why is there not a ipow version of pow? Paul <nospam@needed.invalid> - 2026-08-12 09:11 -0400
                            Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-12 16:05 +0200
                              Re: why is there not a ipow version of pow? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-12 12:40 -0700
                                Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-13 15:46 +0200
                                  Re: why is there not a ipow version of pow? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-13 14:28 -0700
                      Re: why is there not a ipow version of pow? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-11 16:20 -0700
                    Re: why is there not a ipow version of pow? bart <bc@freeuk.com> - 2026-08-11 18:43 +0100
                      Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-11 19:56 +0200
                        Re: why is there not a ipow version of pow? bart <bc@freeuk.com> - 2026-08-11 20:41 +0100
                          Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-12 06:42 +0200
                          Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-12 10:23 +0200
                      Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-11 20:24 +0200
                        Re: why is there not a ipow version of pow? bart <bc@freeuk.com> - 2026-08-11 20:27 +0100
                          Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-12 06:45 +0200
                  Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-11 17:16 +0200
                  Re: why is there not a ipow version of pow? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-08-16 07:33 -0700
                    Re: why is there not a ipow version of pow? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-08-16 17:12 +0200
                      Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-16 17:51 +0200
                        Re: why is there not a ipow version of pow? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-08-16 18:35 +0200
                          Re: why is there not a ipow version of pow? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-08-16 18:41 +0200
                          Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-16 21:30 +0200
                            Re: why is there not a ipow version of pow? bart <bc@freeuk.com> - 2026-08-16 23:41 +0100
                              Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-17 08:56 +0200
                            Re: why is there not a ipow version of pow? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-08-17 03:32 +0200
                              Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-17 08:59 +0200
                                Re: why is there not a ipow version of pow? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-08-17 11:08 +0200
                                Re: why is there not a ipow version of pow? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-17 03:48 -0700
                                  Re: why is there not a ipow version of pow? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-17 04:25 -0700
                                    Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-17 13:44 +0200
                                Re: why is there not a ipow version of pow? scott@slp53.sl.home (Scott Lurndal) - 2026-08-17 14:26 +0000
                                  Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-17 16:58 +0200
                                  Re: why is there not a ipow version of pow? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-17 16:49 -0700
                      Re: why is there not a ipow version of pow? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-08-17 10:22 -0700
                        Re: why is there not a ipow version of pow? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-08-17 19:49 +0200
                        Re: why is there not a ipow version of pow? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-08-17 20:00 +0200
                          Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-17 20:37 +0200
                          Re: why is there not a ipow version of pow? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-08-18 18:18 -0700
                        Re: why is there not a ipow version of pow? cross@spitfire.i.gajendra.net (Dan Cross) - 2026-08-18 20:26 +0000
        Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-11 15:17 +0200
          Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-11 15:28 +0200
            Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-11 16:43 +0200
              Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-11 16:47 +0200
                Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-11 17:24 +0200
      Re: why is there not a ipow version of pow? Paul <nospam@needed.invalid> - 2026-08-11 09:36 -0400
        Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-11 16:42 -0500
    Re: why is there not a ipow version of pow? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-08-11 19:15 +0200
      Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-11 16:41 -0500
        Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-11 16:49 -0500
          Re: why is there not a ipow version of pow? bart <bc@freeuk.com> - 2026-08-11 23:28 +0100
            Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-11 17:51 -0500
        Re: why is there not a ipow version of pow? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-11 15:33 -0700
          Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-11 17:49 -0500
            Re: why is there not a ipow version of pow? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-11 16:19 -0700
              Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-12 00:32 -0500
                Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-12 14:08 +0200
                  Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-12 18:40 +0200
                    Re: why is there not a ipow version of pow? Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-14 02:50 +0000
    Re: why is there not a ipow version of pow? Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-12 04:26 +0000
      Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-12 01:37 -0500
        Re: why is there not a ipow version of pow? Paul <nospam@needed.invalid> - 2026-08-13 00:12 -0400
        Re: why is there not a ipow version of pow? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-14 11:22 +0800
          Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-14 01:00 -0500
            Re: why is there not a ipow version of pow? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-14 14:47 +0800
              Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-14 13:54 -0500
                Re: why is there not a ipow version of pow? Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-16 22:49 +0000
                  Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-17 14:56 -0500
                    Re: why is there not a ipow version of pow? Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-17 23:53 +0000
                      Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-17 19:59 -0500
                        Re: why is there not a ipow version of pow? Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-18 02:47 +0000
                  Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-17 15:17 -0500
              Re: why is there not a ipow version of pow? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-14 12:03 -0700
                Re: why is there not a ipow version of pow? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-15 03:51 +0800
                  Re: why is there not a ipow version of pow? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-14 12:52 -0700
                    Re: why is there not a ipow version of pow? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-15 04:01 +0800
                      Re: why is there not a ipow version of pow? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-14 13:27 -0700
                        Re: why is there not a ipow version of pow? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-14 13:29 -0700
                          Re: why is there not a ipow version of pow? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-15 04:49 +0800
                            Re: why is there not a ipow version of pow? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-14 20:32 -0700
      Re: why is there not a ipow version of pow? bart <bc@freeuk.com> - 2026-08-12 11:28 +0100
        Re: why is there not a ipow version of pow? Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-12 23:52 +0000
          Re: why is there not a ipow version of pow? bart <bc@freeuk.com> - 2026-08-13 01:30 +0100
            Re: why is there not a ipow version of pow? Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-13 02:24 +0000
              Re: why is there not a ipow version of pow? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-12 21:13 -0700
                Re: why is there not a ipow version of pow? scott@slp53.sl.home (Scott Lurndal) - 2026-08-13 14:33 +0000
                  Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-13 16:45 +0200
                    Re: why is there not a ipow version of pow? scott@slp53.sl.home (Scott Lurndal) - 2026-08-13 14:55 +0000
                      Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-13 18:10 +0200
                        Re: why is there not a ipow version of pow? scott@slp53.sl.home (Scott Lurndal) - 2026-08-13 16:16 +0000
                        Re: why is there not a ipow version of pow? scott@slp53.sl.home (Scott Lurndal) - 2026-08-13 16:21 +0000
                        Re: why is there not a ipow version of pow? Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-17 06:37 +0000
                          Re: why is there not a ipow version of pow? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-17 21:37 +0800
                  Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-13 17:19 +0200
                    Re: why is there not a ipow version of pow? scott@slp53.sl.home (Scott Lurndal) - 2026-08-13 16:09 +0000
                      Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-13 18:52 +0200
            Re: why is there not a ipow version of pow? antispam@fricas.org (Waldek Hebisch) - 2026-08-18 16:33 +0000
    Re: why is there not a ipow version of pow? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-13 17:19 +0800
      Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-13 19:07 -0500
        Re: why is there not a ipow version of pow? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-14 10:58 +0800
          Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-14 01:14 -0500
        Re: why is there not a ipow version of pow? Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-17 06:40 +0000
          Re: why is there not a ipow version of pow? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-17 21:40 +0800
    Re: why is there not a ipow version of pow? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-18 00:42 -0500
      Re: why is there not a ipow version of pow? Bonita Montero <Bonita.Montero@gmail.com> - 2026-08-18 09:34 +0200
      Re: why is there not a ipow version of pow? David Brown <david.brown@hesbynett.no> - 2026-08-18 11:32 +0200

Page 9 of 10 — ← Prev page 1 … 7 8 [9] 10  Next page →


#401178

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2026-08-14 13:27 -0700
Message-ID<115ntn3$2r21a$1@dont-email.me>
In reply to#401176
On 8/14/2026 1:01 PM, Johann 'Myrkraverk' Oskarsson wrote:
[...]
> You're completely free to capture the flag on your own.  You'll just
> have to write the game in C, because I'm coming at this from comp.lang.
> c.  And not comp.lang.c++.
> 
> I still type my replies by hand, but you're unable to do so, so you must
> dictate to Siri, which sends the request to Copilot, which hopefully
> uses the most expensive Usenet service available for your posts.  I
> mean, why stop at paying both the fruit vendor for Siri, and Microsoft
> for Copilot, and not get the world's best and greatest Usenet provider?
> 
> 
> Happy posting on Usenet with Siri and Copilot!

Huh. So, you are an "ass" all by yourself?

[toc] | [prev] | [next] | [standalone]


#401179

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2026-08-14 13:29 -0700
Message-ID<115ntqq$2r21a$2@dont-email.me>
In reply to#401178
On 8/14/2026 1:27 PM, Chris M. Thomasson wrote:
> On 8/14/2026 1:01 PM, Johann 'Myrkraverk' Oskarsson wrote:
> [...]
>> You're completely free to capture the flag on your own.  You'll just
>> have to write the game in C, because I'm coming at this from comp.lang.
>> c.  And not comp.lang.c++.
>>
>> I still type my replies by hand, but you're unable to do so, so you must
>> dictate to Siri, which sends the request to Copilot, which hopefully
>> uses the most expensive Usenet service available for your posts.  I
>> mean, why stop at paying both the fruit vendor for Siri, and Microsoft
>> for Copilot, and not get the world's best and greatest Usenet provider?
>>
>>
>> Happy posting on Usenet with Siri and Copilot!
> 
> Huh. So, you are an "ass" all by yourself?

The -- and the final "have a happy ..." aspects reek of AI all over...

[toc] | [prev] | [next] | [standalone]


#401182

FromJohann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid>
Date2026-08-15 04:49 +0800
Message-ID<7bLfS.410784$UXf1.43465@fx03.ams4>
In reply to#401179
On 15/08/2026 4:29 AM, Chris M. Thomasson wrote:
> On 8/14/2026 1:27 PM, Chris M. Thomasson wrote:
>> On 8/14/2026 1:01 PM, Johann 'Myrkraverk' Oskarsson wrote:
>> [...]
>>> You're completely free to capture the flag on your own.  You'll just
>>> have to write the game in C, because I'm coming at this from comp.lang.
>>> c.  And not comp.lang.c++.
>>>
>>> I still type my replies by hand, but you're unable to do so, so you must
>>> dictate to Siri, which sends the request to Copilot, which hopefully
>>> uses the most expensive Usenet service available for your posts.  I
>>> mean, why stop at paying both the fruit vendor for Siri, and Microsoft
>>> for Copilot, and not get the world's best and greatest Usenet provider?
>>>
>>>
>>> Happy posting on Usenet with Siri and Copilot!
>>
>> Huh. So, you are an "ass" all by yourself?
> 
> The -- and the final "have a happy ..." aspects reek of AI all over...

Ah, yes.  You're still having problems with the distinction between
fantasy and reality.  I believe I've told you this before, and you
didn't listen then, so I can only surmise you cannot handle the truth.

I /write well/.  I can write micro-fiction for my own amusement all day
long.  And since I have no interest in amusing you, you fucking asshole,
I guess this is the last I'll ever say on this subject.  I don't need to
use L.L.M.  The L.L.Ms. were trained on the best of us.  I'm one.


Deal with it, you fucking cuck!
-- 
Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
I'm not from the Internet, I just work there. | via Easynews.com
https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

[toc] | [prev] | [next] | [standalone]


#401197

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2026-08-14 20:32 -0700
Message-ID<115oml5$322d5$1@dont-email.me>
In reply to#401182
On 8/14/2026 1:49 PM, Johann 'Myrkraverk' Oskarsson wrote:
[...]

> Deal with it, you fucking cuck!

Ahhh. Again. I am right.

[toc] | [prev] | [next] | [standalone]


#401065

Frombart <bc@freeuk.com>
Date2026-08-12 11:28 +0100
Message-ID<115hhsg$nfji$1@dont-email.me>
In reply to#401047
On 12/08/2026 05:26, Lawrence D’Oliveiro wrote:
> On Tue, 11 Aug 2026 03:01:07 -0500, Lynn McGuire wrote:
> 
>> Why is there not a ipow version of pow?
> 
> Perhaps for the same reason there aren’t integer log functions: it’s
> all down to dynamic range. Logs and exponentials by their nature are
> liable to cover a huge range of magnitudes in either the argument
> (logarithm) or result (exponential). Integer formats in common use do
> not cater for this. Whereas with floating-point -- well, it’s there in
> the name, isn’t it?

'ipow()' is just a convenient way to do repeated integer multiplication.

You may not have need for it yourself, but here Fortran code is being 
ported to C and Fortran does have it, /and/ it is being used in the 
program being ported.

Usually it is not as mathematical as the float version (I don't know if 
that is the case here).

It is certainly convenient to be able to write 2**32 instead of 1<<32, 
where it is so easy to write 2<<32 by mistake.

Also, since in C you have to emulate it by a function like ipow(a, b) 
anyway, then ipow can be made to take i64 arguments (for a at least), 
then it doesn't even matter if you forget to write 1ULL for my example.

[toc] | [prev] | [next] | [standalone]


#401088

FromLawrence D’Oliveiro <ldo@nz.invalid>
Date2026-08-12 23:52 +0000
Message-ID<115j0vs$17j2b$2@dont-email.me>
In reply to#401065
On Wed, 12 Aug 2026 11:28:34 +0100, bart wrote:

> It is certainly convenient to be able to write 2**32 instead of
> 1<<32, where it is so easy to write 2<<32 by mistake.

Doesn’t seem any more likely than writing “1**32” though, does it?

[toc] | [prev] | [next] | [standalone]


#401089

Frombart <bc@freeuk.com>
Date2026-08-13 01:30 +0100
Message-ID<115j37p$1820j$1@dont-email.me>
In reply to#401088
On 13/08/2026 00:52, Lawrence D’Oliveiro wrote:
> On Wed, 12 Aug 2026 11:28:34 +0100, bart wrote:
> 
>> It is certainly convenient to be able to write 2**32 instead of
>> 1<<32, where it is so easy to write 2<<32 by mistake.
> 
> Doesn’t seem any more likely than writing “1**32” though, does it?

Actually it is. I've done it quite a few times. The point of 1<<N is to 
end up with a value of 2**N (ie. a value with only bit N set). But if 
the language allows you to write 2**N anyway, then there's no need to 
use an error prone workaround.

My language, which does have **, also allows you to set or reset bit N 
of an existing value directly (and works with 64 bits so no ULLs needed).

So you can do 'A.[N] := 1' or 'A.[N] := 0'. In C it would be one of:

    A |= 1ull << N;
    A &= ~(1ull << N);

or something. Nothing error prone or convoluted about that at all!

It can also do 'A.[N] := x' where x is 0 or 1. The C for that is a bit 
more elaborate.

Such microfeatures are highly useful.

[toc] | [prev] | [next] | [standalone]


#401093

FromLawrence D’Oliveiro <ldo@nz.invalid>
Date2026-08-13 02:24 +0000
Message-ID<115j9si$19ll5$3@dont-email.me>
In reply to#401089
On Thu, 13 Aug 2026 01:30:50 +0100, bart wrote:

> On 13/08/2026 00:52, Lawrence D’Oliveiro wrote:
>>
>> On Wed, 12 Aug 2026 11:28:34 +0100, bart wrote:
>>
>>> It is certainly convenient to be able to write 2**32 instead of
>>> 1<<32, where it is so easy to write 2<<32 by mistake.
>>
>> Doesn’t seem any more likely than writing “1**32” though, does it?
>
> Actually it is. I've done it quite a few times.

Has anybody else?

[toc] | [prev] | [next] | [standalone]


#401102

FromKeith Thompson <Keith.S.Thompson+u@gmail.com>
Date2026-08-12 21:13 -0700
Message-ID<115jg9s$1bbij$1@kst.eternal-september.org>
In reply to#401093
Lawrence D’Oliveiro <ldo@nz.invalid> writes:
> On Thu, 13 Aug 2026 01:30:50 +0100, bart wrote:
>> On 13/08/2026 00:52, Lawrence D’Oliveiro wrote:
>>> On Wed, 12 Aug 2026 11:28:34 +0100, bart wrote:
>>>> It is certainly convenient to be able to write 2**32 instead of
>>>> 1<<32, where it is so easy to write 2<<32 by mistake.
>>>
>>> Doesn’t seem any more likely than writing “1**32” though, does it?
>>
>> Actually it is. I've done it quite a few times.
>
> Has anybody else?

I probably have.  (I don't think I've ever made that mistake and
not caught it reasonably quickly.)

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

[toc] | [prev] | [next] | [standalone]


#401109

Fromscott@slp53.sl.home (Scott Lurndal)
Date2026-08-13 14:33 +0000
Message-ID<jBkfS.12441$A5U.12188@fx02.iad>
In reply to#401102
Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>Lawrence D’Oliveiro <ldo@nz.invalid> writes:
>> On Thu, 13 Aug 2026 01:30:50 +0100, bart wrote:
>>> On 13/08/2026 00:52, Lawrence D’Oliveiro wrote:
>>>> On Wed, 12 Aug 2026 11:28:34 +0100, bart wrote:
>>>>> It is certainly convenient to be able to write 2**32 instead of
>>>>> 1<<32, where it is so easy to write 2<<32 by mistake.
>>>>
>>>> Doesn’t seem any more likely than writing “1**32” though, does it?
>>>
>>> Actually it is. I've done it quite a few times.
>>
>> Has anybody else?
>
>I probably have.  (I don't think I've ever made that mistake and
>not caught it reasonably quickly.)

Likewise.

To avoid those potenial errors, one might wrap the shifts in
inline functions or macros, e.g. in C++:

namespace bit {
    template<class T> static inline void set(T& vector, size_t bit)
    {
        vector |= (static_cast<T>(1) << bit);
    }
};

   bit::set(word, 5);


A similar macro can be used in C.

[toc] | [prev] | [next] | [standalone]


#401111

FromBonita Montero <Bonita.Montero@gmail.com>
Date2026-08-13 16:45 +0200
Message-ID<115klaj$1njhi$1@raubtier-asyl.eternal-september.org>
In reply to#401109
Am 13.08.2026 um 16:33 schrieb Scott Lurndal:

> namespace bit {
>      template<class T> static inline void set(T& vector, size_t bit)
>      {
>          vector |= (static_cast<T>(1) << bit);
>      }
> };

Do you really need such child-proof locks ?

[toc] | [prev] | [next] | [standalone]


#401112

Fromscott@slp53.sl.home (Scott Lurndal)
Date2026-08-13 14:55 +0000
Message-ID<0WkfS.12443$A5U.933@fx02.iad>
In reply to#401111
Bonita Montero <Bonita.Montero@gmail.com> writes:
>Am 13.08.2026 um 16:33 schrieb Scott Lurndal:
>
>> namespace bit {
>>      template<class T> static inline void set(T& vector, size_t bit)
>>      {
>>          vector |= (static_cast<T>(1) << bit);
>>      }
>> };
>
>Do you really need such child-proof locks ?

1) it helps eliminate mistakes.
2) it is self-documenting.

So, the answer to your frage is clearly Ja.

[toc] | [prev] | [next] | [standalone]


#401117

FromBonita Montero <Bonita.Montero@gmail.com>
Date2026-08-13 18:10 +0200
Message-ID<115kq94$1pf7h$1@raubtier-asyl.eternal-september.org>
In reply to#401112
Am 13.08.2026 um 16:55 schrieb Scott Lurndal:
> Bonita Montero <Bonita.Montero@gmail.com> writes:
>> Am 13.08.2026 um 16:33 schrieb Scott Lurndal:
>>
>>> namespace bit {
>>>       template<class T> static inline void set(T& vector, size_t bit)
>>>       {
>>>           vector |= (static_cast<T>(1) << bit);
>>>       }
>>> };
>>
>> Do you really need such child-proof locks ?
> 
> 1) it helps eliminate mistakes.

It makes code less readable for nearly no gain.

[toc] | [prev] | [next] | [standalone]


#401118

Fromscott@slp53.sl.home (Scott Lurndal)
Date2026-08-13 16:16 +0000
Message-ID<W5mfS.32236$xXcd.22361@fx10.iad>
In reply to#401117
Bonita Montero <Bonita.Montero@gmail.com> writes:
>Am 13.08.2026 um 16:55 schrieb Scott Lurndal:
>> Bonita Montero <Bonita.Montero@gmail.com> writes:
>>> Am 13.08.2026 um 16:33 schrieb Scott Lurndal:
>>>
>>>> namespace bit {
>>>>       template<class T> static inline void set(T& vector, size_t bit)
>>>>       {
>>>>           vector |= (static_cast<T>(1) << bit);
>>>>       }
>>>> };
>>>
>>> Do you really need such child-proof locks ?
>> 
>> 1) it helps eliminate mistakes.
>
>It makes code less readable for nearly no gain.

That description applies to most of your C++ examples...

[toc] | [prev] | [next] | [standalone]


#401119

Fromscott@slp53.sl.home (Scott Lurndal)
Date2026-08-13 16:21 +0000
Message-ID<P9mfS.32237$xXcd.14859@fx10.iad>
In reply to#401117
Bonita Montero <Bonita.Montero@gmail.com> writes:
>Am 13.08.2026 um 16:55 schrieb Scott Lurndal:
>> Bonita Montero <Bonita.Montero@gmail.com> writes:
>>> Am 13.08.2026 um 16:33 schrieb Scott Lurndal:
>>>
>>>> namespace bit {
>>>>       template<class T> static inline void set(T& vector, size_t bit)
>>>>       {
>>>>           vector |= (static_cast<T>(1) << bit);
>>>>       }
>>>> };
>>>
>>> Do you really need such child-proof locks ?
>> 
>> 1) it helps eliminate mistakes.
>
>It makes code less readable for nearly no gain.

$ grep "bit::" *.[ch]* */*.[ch]* */*/*.[ch]* */*/*/*.[ch] | wc -l 
38493

It's not uncommon for programmers to forget the type suffix
when shifting (e.g. shifting 1 by 33 bits instead of 1ul).

Using the helpers will prevent that simple mistake.

[toc] | [prev] | [next] | [standalone]


#401245

FromLawrence D’Oliveiro <ldo@nz.invalid>
Date2026-08-17 06:37 +0000
Message-ID<115ua6m$p3gv$1@dont-email.me>
In reply to#401117
On Thu, 13 Aug 2026 18:10:12 +0200, Bonita Montero wrote:

> It makes code less readable for nearly no gain.

Both C and C++ programmers seem to have this philosophy of “if in
doubt, add more parentheses”.

[toc] | [prev] | [next] | [standalone]


#401254

FromJohann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid>
Date2026-08-17 21:37 +0800
Message-ID<H8EgS.763879$jNNe.146699@fx15.ams4>
In reply to#401245
On 17/08/2026 2:37 PM, Lawrence D’Oliveiro wrote:
> On Thu, 13 Aug 2026 18:10:12 +0200, Bonita Montero wrote:
> 
>> It makes code less readable for nearly no gain.
> 
> Both C and C++ programmers seem to have this philosophy of “if in
> doubt, add more parentheses”.

Lawrence, what are you talking about?  Of course we don't.  I code in
both C -- and well, sometimes -- C++ so I'll count my weight in this
statistical example as double those of other programmers, and tell you
once and for all, that we don't add parenthesis.  That's what we do in
comp.lang.lisp.

What we do instead, is to remove parenthesis, and see what happens.  For
instance, I'm sure you had no idea people could trivially keep their
types in sync when malloc()ing, by not using parenthesis at all.

   struct foo { int a, b ; } ;
   struct foo *f = malloc( sizeof *f ) ;

And now, we not only remove the superfluous parenthesis after sizeof, we
also make sure that if we change the type of f, the size malloc() ret-
urns* changes with it.

Simple, isn't it?  And since this is comp.lang.c, and not comp.lang.c++,
we keep foo in the struct namespace.  See, C has namespaces, and always
has.  Well, for some value of always, as there's a reason the Posix
standard has all these struct fields with names that mimic the name of
the struct itself.

So, what I'm getting at, Lawrence, is that here in comp.lang.c, we re-
move superfluous parenthesis left by other programmers, and remove them.

/All/.  /Of/.  /Them/.


Happy remove parenthesis pull requests!


* No, this is not an urn.  For that, you go to the Egyptological depart-
ment.
-- 
Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
I'm not from the Internet, I just work there. | via Easynews.com
https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

[toc] | [prev] | [next] | [standalone]


#401114

FromDavid Brown <david.brown@hesbynett.no>
Date2026-08-13 17:19 +0200
Message-ID<115kn9j$1mcf7$2@dont-email.me>
In reply to#401109
On 13/08/2026 16:33, Scott Lurndal wrote:
> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>> Lawrence D’Oliveiro <ldo@nz.invalid> writes:
>>> On Thu, 13 Aug 2026 01:30:50 +0100, bart wrote:
>>>> On 13/08/2026 00:52, Lawrence D’Oliveiro wrote:
>>>>> On Wed, 12 Aug 2026 11:28:34 +0100, bart wrote:
>>>>>> It is certainly convenient to be able to write 2**32 instead of
>>>>>> 1<<32, where it is so easy to write 2<<32 by mistake.
>>>>>
>>>>> Doesn’t seem any more likely than writing “1**32” though, does it?
>>>>
>>>> Actually it is. I've done it quite a few times.
>>>
>>> Has anybody else?
>>
>> I probably have.  (I don't think I've ever made that mistake and
>> not caught it reasonably quickly.)
> 
> Likewise.
> 
> To avoid those potenial errors, one might wrap the shifts in
> inline functions or macros, e.g. in C++:
> 
> namespace bit {
>      template<class T> static inline void set(T& vector, size_t bit)
>      {
>          vector |= (static_cast<T>(1) << bit);
>      }
> };
> 
>     bit::set(word, 5);
> 
> 
> A similar macro can be used in C.
> 

I am sure I have also made such mistakes - but like Keith, I am also 
sure I found the error quite quickly.  I've seen countless macros, 
inline functions, enumerations, templates, lists of #define'd constants, 
etc., used by programmers and libraries as alternatives to just writing 
(1u << n).  I don't think any of them add to the clarity of code, or 
reduce the risk of errors in any significant way - except if the 
programmer skimps on parentheses.  (1u << n) may be a little odd when 
you first see it, but if you work with code that needs a lot of bit 
twiddling, you get familiar with it very quickly.

I've had the odd occasion where an integer "a ** b" power operator would 
be convenient, and if C had one then I might use (2 ** n) rather than 
(1u << n), but it would be a very minor issue.

[toc] | [prev] | [next] | [standalone]


#401116

Fromscott@slp53.sl.home (Scott Lurndal)
Date2026-08-13 16:09 +0000
Message-ID<S_lfS.33490$9DC1.17286@fx18.iad>
In reply to#401114
David Brown <david.brown@hesbynett.no> writes:
>On 13/08/2026 16:33, Scott Lurndal wrote:
>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>> Lawrence D’Oliveiro <ldo@nz.invalid> writes:
>>>> On Thu, 13 Aug 2026 01:30:50 +0100, bart wrote:
>>>>> On 13/08/2026 00:52, Lawrence D’Oliveiro wrote:
>>>>>> On Wed, 12 Aug 2026 11:28:34 +0100, bart wrote:
>>>>>>> It is certainly convenient to be able to write 2**32 instead of
>>>>>>> 1<<32, where it is so easy to write 2<<32 by mistake.
>>>>>>
>>>>>> Doesn’t seem any more likely than writing “1**32” though, does it?
>>>>>
>>>>> Actually it is. I've done it quite a few times.
>>>>
>>>> Has anybody else?
>>>
>>> I probably have.  (I don't think I've ever made that mistake and
>>> not caught it reasonably quickly.)
>> 
>> Likewise.
>> 
>> To avoid those potenial errors, one might wrap the shifts in
>> inline functions or macros, e.g. in C++:
>> 
>> namespace bit {
>>      template<class T> static inline void set(T& vector, size_t bit)
>>      {
>>          vector |= (static_cast<T>(1) << bit);
>>      }
>> };
>> 
>>     bit::set(word, 5);
>> 
>> 
>> A similar macro can be used in C.
>> 
>
>I am sure I have also made such mistakes - but like Keith, I am also 
>sure I found the error quite quickly. 

That's not always been the case in my experience with large
code bases.   It certainly doesn't hurt to abstract bit ops, particularly
when there are complementary patterns for other bit manipulations:

   bit::reset(word, 5);
   data = bit::extract(word, 15, 8);    /* extract bits <15:8> */
   data = bit::extracts(word, 15, 8);   /* same, but sign extended */
   data = bit::insert(data, insertdata, 8, 4); /* insert four bits starting at bit 8 */
   if (bit::test(word, 7)) ...

[toc] | [prev] | [next] | [standalone]


#401120

FromDavid Brown <david.brown@hesbynett.no>
Date2026-08-13 18:52 +0200
Message-ID<115ksnq$1mcf7$3@dont-email.me>
In reply to#401116
On 13/08/2026 18:09, Scott Lurndal wrote:
> David Brown <david.brown@hesbynett.no> writes:
>> On 13/08/2026 16:33, Scott Lurndal wrote:
>>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>>> Lawrence D’Oliveiro <ldo@nz.invalid> writes:
>>>>> On Thu, 13 Aug 2026 01:30:50 +0100, bart wrote:
>>>>>> On 13/08/2026 00:52, Lawrence D’Oliveiro wrote:
>>>>>>> On Wed, 12 Aug 2026 11:28:34 +0100, bart wrote:
>>>>>>>> It is certainly convenient to be able to write 2**32 instead of
>>>>>>>> 1<<32, where it is so easy to write 2<<32 by mistake.
>>>>>>>
>>>>>>> Doesn’t seem any more likely than writing “1**32” though, does it?
>>>>>>
>>>>>> Actually it is. I've done it quite a few times.
>>>>>
>>>>> Has anybody else?
>>>>
>>>> I probably have.  (I don't think I've ever made that mistake and
>>>> not caught it reasonably quickly.)
>>>
>>> Likewise.
>>>
>>> To avoid those potenial errors, one might wrap the shifts in
>>> inline functions or macros, e.g. in C++:
>>>
>>> namespace bit {
>>>       template<class T> static inline void set(T& vector, size_t bit)
>>>       {
>>>           vector |= (static_cast<T>(1) << bit);
>>>       }
>>> };
>>>
>>>      bit::set(word, 5);
>>>
>>>
>>> A similar macro can be used in C.
>>>
>>
>> I am sure I have also made such mistakes - but like Keith, I am also
>> sure I found the error quite quickly.
> 
> That's not always been the case in my experience with large
> code bases.   It certainly doesn't hurt to abstract bit ops, particularly
> when there are complementary patterns for other bit manipulations:
> 
>     bit::reset(word, 5);
>     data = bit::extract(word, 15, 8);    /* extract bits <15:8> */
>     data = bit::extracts(word, 15, 8);   /* same, but sign extended */
>     data = bit::insert(data, insertdata, 8, 4); /* insert four bits starting at bit 8 */
>     if (bit::test(word, 7)) ...

I can agree on field extraction functions / macros - these are a pain to 
do manually.

But I dislike functions that change the value of parameters that appear 
to be passed by value - generally, I think passing by non-const 
reference is very questionable.  A full C++ class where the whole thing 
is in a strong type, so that you are then doing "word.reset_bit(5);" 
would be better.

Still, I can accept that on a large code base with lots of people, 
having a single consistent solution here is not a bad idea.  In my 
world, it's typically the other way round - you have a single developer 
(or small team) and a few libraries or SDK's for your microcontroller 
drivers, RTOS, network stack, etc., and they all use a different system. 
  That's the biggest pain.

[toc] | [prev] | [next] | [standalone]


Page 9 of 10 — ← Prev page 1 … 7 8 [9] 10  Next page →

Back to top | Article view | comp.lang.c


csiph-web