Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #84323 > unrolled thread
| Started by | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| First post | 2022-05-29 02:59 +0200 |
| Last post | 2022-06-01 18:39 +0200 |
| Articles | 20 on this page of 157 — 19 participants |
Back to article view | Back to comp.lang.c++
Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-05-29 02:59 +0200
Re: Wikipedia Juha Nieminen <nospam@thanks.invalid> - 2022-05-29 05:46 +0000
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-05-29 08:03 +0200
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-05-29 08:34 +0200
Re: Wikipedia Öö Tiib <ootiib@hot.ee> - 2022-05-29 01:36 -0700
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-05-29 10:37 +0200
Re: Wikipedia Öö Tiib <ootiib@hot.ee> - 2022-05-29 02:09 -0700
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-05-29 11:16 +0200
Re: Wikipedia Öö Tiib <ootiib@hot.ee> - 2022-05-29 03:08 -0700
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-05-29 12:44 +0200
Re: Wikipedia Paavo Helde <eesnimi@osa.pri.ee> - 2022-05-29 16:05 +0300
Re: Wikipedia Freethinker <freethinker@mymail.com> - 2022-05-29 15:19 +0200
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-05-29 15:27 +0200
Re: Wikipedia Manu Raju <MR@invalid.invalid> - 2022-05-29 17:26 +0100
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-05-29 19:18 +0200
Re: Wikipedia scott@slp53.sl.home (Scott Lurndal) - 2022-05-29 17:49 +0000
Re: Wikipedia Manfred <noname@add.invalid> - 2022-05-30 00:25 +0200
Re: Wikipedia Popping Mad <rainbow@colition.gov> - 2022-06-04 13:00 -0400
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-04 19:19 +0200
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-05-29 11:48 +0200
Re: Wikipedia Juha Nieminen <nospam@thanks.invalid> - 2022-05-30 06:06 +0000
Re: Wikipedia Popping Mad <rainbow@colition.gov> - 2022-06-04 13:02 -0400
Re: Wikipedia Manu Raju <MR@invalid.invalid> - 2022-05-29 17:18 +0100
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-05-29 18:22 +0200
Re: Wikipedia Juha Nieminen <nospam@thanks.invalid> - 2022-05-30 06:08 +0000
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-05-31 04:41 +0200
Re: Wikipedia Juha Nieminen <nospam@thanks.invalid> - 2022-05-30 06:06 +0000
Re: Wikipedia Mr Flibble <flibble@reddwarf.jmc.corp> - 2022-05-30 19:31 +0100
Re: Wikipedia Mr Flibble <flibble@reddwarf.jmc.corp> - 2022-05-30 19:52 +0100
Re: Wikipedia Manfred <noname@add.invalid> - 2022-05-31 14:34 +0200
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-05-31 15:15 +0200
Re: Wikipedia Mr Flibble <flibble@reddwarf.jmc.corp> - 2022-05-31 18:00 +0100
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-05-31 19:06 +0200
Re: Wikipedia Mr Flibble <flibble@reddwarf.jmc.corp> - 2022-05-31 18:43 +0100
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-05-31 19:48 +0200
Re: Wikipedia David Brown <david.brown@hesbynett.no> - 2022-06-01 09:26 +0200
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-01 09:44 +0200
Re: Wikipedia Öö Tiib <ootiib@hot.ee> - 2022-06-01 01:47 -0700
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-01 13:53 +0200
Re: Wikipedia David Brown <david.brown@hesbynett.no> - 2022-06-01 17:05 +0200
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-01 17:06 +0200
Re: Wikipedia Juha Nieminen <nospam@thanks.invalid> - 2022-06-02 04:57 +0000
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-02 07:43 +0200
Re: Wikipedia Juha Nieminen <nospam@thanks.invalid> - 2022-06-02 08:53 +0000
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-02 12:56 +0200
Re: Wikipedia Juha Nieminen <nospam@thanks.invalid> - 2022-06-02 12:46 +0000
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-02 14:56 +0200
Re: Wikipedia Juha Nieminen <nospam@thanks.invalid> - 2022-06-03 04:14 +0000
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-03 06:19 +0200
Re: Wikipedia Juha Nieminen <nospam@thanks.invalid> - 2022-06-03 04:26 +0000
Re: Wikipedia Mr Flibble <flibble@reddwarf.jmc.corp> - 2022-06-03 14:22 +0100
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-03 15:34 +0200
Re: Wikipedia "daniel...@gmail.com" <danielaparker@gmail.com> - 2022-06-03 07:24 -0700
Re: Wikipedia Juha Nieminen <nospam@thanks.invalid> - 2022-06-03 14:56 +0000
Re: Wikipedia "daniel...@gmail.com" <danielaparker@gmail.com> - 2022-06-03 08:06 -0700
Re: Wikipedia David Brown <david.brown@hesbynett.no> - 2022-06-03 17:30 +0200
Re: Wikipedia "daniel...@gmail.com" <danielaparker@gmail.com> - 2022-06-03 10:37 -0700
Re: Wikipedia David Brown <david.brown@hesbynett.no> - 2022-06-03 20:33 +0200
Re: Wikipedia scott@slp53.sl.home (Scott Lurndal) - 2022-06-03 18:59 +0000
Re: Wikipedia "daniel...@gmail.com" <danielaparker@gmail.com> - 2022-06-03 12:35 -0700
Re: Wikipedia Freethinker <freethinker@mymail.com> - 2022-06-03 23:42 +0200
Re: Wikipedia Muttley@dastardlyhq.com - 2022-06-04 08:10 +0000
Re: Wikipedia "daniel...@gmail.com" <danielaparker@gmail.com> - 2022-06-03 11:59 -0700
Re: Wikipedia David Brown <david.brown@hesbynett.no> - 2022-06-04 15:27 +0200
Re: Wikipedia Juha Nieminen <nospam@thanks.invalid> - 2022-06-04 15:31 +0000
Re: Wikipedia Manfred <noname@add.invalid> - 2022-06-03 17:02 +0200
Re: Wikipedia "daniel...@gmail.com" <danielaparker@gmail.com> - 2022-06-03 08:11 -0700
Re: Wikipedia "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-06-03 14:23 -0700
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-02 14:58 +0200
Re: Wikipedia Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-06-04 08:00 -0700
Re: Wikipedia David Brown <david.brown@hesbynett.no> - 2022-06-02 16:00 +0200
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-02 16:09 +0200
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-02 16:14 +0200
Re: Wikipedia Popping Mad <rainbow@colition.gov> - 2022-06-04 13:20 -0400
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-04 19:23 +0200
Re: Wikipedia Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-06-02 04:40 -0700
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-02 14:00 +0200
Re: Wikipedia Juha Nieminen <nospam@thanks.invalid> - 2022-06-02 12:47 +0000
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-02 14:59 +0200
Re: Wikipedia Juha Nieminen <nospam@thanks.invalid> - 2022-06-03 04:17 +0000
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-03 06:20 +0200
Re: Wikipedia Juha Nieminen <nospam@thanks.invalid> - 2022-06-03 04:27 +0000
Re: Wikipedia David Brown <david.brown@hesbynett.no> - 2022-06-02 16:13 +0200
Re: Wikipedia Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-06-02 10:09 -0700
Re: Wikipedia David Brown <david.brown@hesbynett.no> - 2022-06-02 22:35 +0200
Re: Wikipedia Juha Nieminen <nospam@thanks.invalid> - 2022-06-03 04:22 +0000
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-03 06:23 +0200
Re: Wikipedia Juha Nieminen <nospam@thanks.invalid> - 2022-06-03 04:28 +0000
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-03 06:35 +0200
Re: Wikipedia Juha Nieminen <nospam@thanks.invalid> - 2022-06-03 05:22 +0000
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-03 07:23 +0200
Re: Wikipedia "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-06-02 22:25 -0700
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-03 07:28 +0200
Re: Wikipedia "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-06-02 22:31 -0700
Re: Wikipedia Juha Nieminen <nospam@thanks.invalid> - 2022-06-03 06:22 +0000
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-03 08:38 +0200
Re: Wikipedia Juha Nieminen <nospam@thanks.invalid> - 2022-06-03 10:14 +0000
Re: Wikipedia "daniel...@gmail.com" <danielaparker@gmail.com> - 2022-06-03 06:32 -0700
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-03 15:35 +0200
Re: Wikipedia "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-06-03 14:12 -0700
Re: Wikipedia David Brown <david.brown@hesbynett.no> - 2022-06-03 10:31 +0200
Re: Wikipedia Manfred <noname@add.invalid> - 2022-06-02 19:12 +0200
Re: Wikipedia Popping Mad <rainbow@colition.gov> - 2022-06-04 13:09 -0400
Re: Wikipedia Manu Raju <MR@invalid.invalid> - 2022-06-02 17:54 +0100
Re: Wikipedia Paavo Helde <eesnimi@osa.pri.ee> - 2022-06-02 20:40 +0300
Re: Wikipedia Manu Raju <MR@invalid.invalid> - 2022-06-02 18:50 +0100
Re: Wikipedia Juha Nieminen <nospam@thanks.invalid> - 2022-06-03 04:25 +0000
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-01 14:21 +0200
Re: Wikipedia "daniel...@gmail.com" <danielaparker@gmail.com> - 2022-06-01 06:17 -0700
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-01 15:34 +0200
Re: Wikipedia "daniel...@gmail.com" <danielaparker@gmail.com> - 2022-06-01 07:13 -0700
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-01 16:55 +0200
Re: Wikipedia David Brown <david.brown@hesbynett.no> - 2022-06-01 16:29 +0200
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-01 16:56 +0200
Re: Wikipedia "daniel...@gmail.com" <danielaparker@gmail.com> - 2022-06-01 07:58 -0700
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-01 17:07 +0200
Re: Wikipedia David Brown <david.brown@hesbynett.no> - 2022-06-01 17:50 +0200
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-01 18:11 +0200
Re: Wikipedia David Brown <david.brown@hesbynett.no> - 2022-06-01 17:41 +0200
Re: Wikipedia Manfred <noname@add.invalid> - 2022-06-01 17:42 +0200
Re: Wikipedia "daniel...@gmail.com" <danielaparker@gmail.com> - 2022-06-01 09:12 -0700
Re: Wikipedia Manfred <noname@add.invalid> - 2022-06-01 18:35 +0200
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-01 18:36 +0200
Re: Wikipedia Manfred <noname@add.invalid> - 2022-06-01 18:59 +0200
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-01 19:04 +0200
Re: Wikipedia "daniel...@gmail.com" <danielaparker@gmail.com> - 2022-06-01 10:04 -0700
Re: Wikipedia Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-06-07 08:28 -0700
Re: Wikipedia David Brown <david.brown@hesbynett.no> - 2022-06-01 21:22 +0200
Re: Wikipedia "daniel...@gmail.com" <danielaparker@gmail.com> - 2022-06-01 13:43 -0700
Re: Wikipedia David Brown <david.brown@hesbynett.no> - 2022-06-02 10:07 +0200
Re: Wikipedia Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-06-07 08:21 -0700
Re: Wikipedia "daniel...@gmail.com" <danielaparker@gmail.com> - 2022-06-10 07:18 -0700
Re: Wikipedia muttley@dastardlyhq.com - 2022-05-31 18:34 +0000
Re: Wikipedia Mr Flibble <flibble@reddwarf.jmc.corp> - 2022-05-31 19:37 +0100
Re: Wikipedia muttley@dastardlyhq.com - 2022-05-31 18:42 +0000
Re: Wikipedia Mr Flibble <flibble@reddwarf.jmc.corp> - 2022-05-31 20:00 +0100
Re: Wikipedia muttley@dastardlyhq.com - 2022-05-31 19:19 +0000
Re: Wikipedia Mr Flibble <flibble@reddwarf.jmc.corp> - 2022-05-31 20:28 +0100
Re: Wikipedia muttley@dastardlyhq.com - 2022-06-01 18:07 +0000
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-01 20:28 +0200
Re: Wikipedia scott@slp53.sl.home (Scott Lurndal) - 2022-05-31 19:37 +0000
Re: Wikipedia Vir Campestris <vir.campestris@invalid.invalid> - 2022-05-31 21:27 +0100
Re: "std::" (was: Wikipedia) Mr Flibble <flibble@reddwarf.jmc.corp> - 2022-05-31 21:17 +0100
Re: "std::" (was: Wikipedia) Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-01 06:33 +0200
Re: Wikipedia David Brown <david.brown@hesbynett.no> - 2022-06-01 09:34 +0200
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-01 05:40 +0200
Re: Wikipedia Manu Raju <MR@invalid.invalid> - 2022-05-31 17:18 +0100
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-05-31 18:25 +0200
Re: Wikipedia David Brown <david.brown@hesbynett.no> - 2022-06-01 09:38 +0200
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-01 09:46 +0200
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-01 10:16 +0200
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-01 10:21 +0200
Re: Wikipedia David Brown <david.brown@hesbynett.no> - 2022-06-01 17:13 +0200
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-01 17:15 +0200
Re: Wikipedia David Brown <david.brown@hesbynett.no> - 2022-06-01 18:12 +0200
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-01 18:18 +0200
Re: Wikipedia Bonita Montero <Bonita.Montero@gmail.com> - 2022-06-01 18:39 +0200
Page 5 of 8 — ← Prev page 1 2 3 4 [5] 6 7 8 Next page →
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2022-06-03 06:20 +0200 |
| Message-ID | <t7c25n$2pg$2@dont-email.me> |
| In reply to | #84484 |
Am 03.06.2022 um 06:17 schrieb Juha Nieminen: > Bonita Montero <Bonita.Montero@gmail.com> wrote: >> who want to dictate their taste > > You have been repeating that quite many times now. > And then you are saying it's me who's obsessed. If you coud argue on my level this would be different.
[toc] | [prev] | [next] | [standalone]
| From | Juha Nieminen <nospam@thanks.invalid> |
|---|---|
| Date | 2022-06-03 04:27 +0000 |
| Message-ID | <t7c2jh$1fft$4@gioia.aioe.org> |
| In reply to | #84486 |
Bonita Montero <Bonita.Montero@gmail.com> wrote: > Am 03.06.2022 um 06:17 schrieb Juha Nieminen: >> Bonita Montero <Bonita.Montero@gmail.com> wrote: >>> who want to dictate their taste >> >> You have been repeating that quite many times now. >> And then you are saying it's me who's obsessed. > > If you coud argue on my level this would be different. Luckily for me I don't.
[toc] | [prev] | [next] | [standalone]
| From | David Brown <david.brown@hesbynett.no> |
|---|---|
| Date | 2022-06-02 16:13 +0200 |
| Message-ID | <t7aghh$20b$1@dont-email.me> |
| In reply to | #84466 |
On 02/06/2022 13:40, Malcolm McLean wrote: > On Thursday, 2 June 2022 at 09:53:22 UTC+1, Juha Nieminen wrote: >> >> I can't think of any situation where "using namespace std;" would >> actually introduce some benefit to the code, in terms of readability >> or otherwise. I can think of plenty of examples of the opposite. >> > I tend to include the C math library. > > The reason is that my code involves a lot of complicated mathematical > formulae. The convention is that the identifier "cos" means "take the > cosine". There's no broad convention for using "std::cos", "math.cos". > or even "cosine". > Also, the convention is that a formula is one expression. Breaking it > up over several lines makes it harder rather than easier to read. > > So you've got long complicated expressions with calls to common > functions embedded in them. It's clearly better to be able to use the > accepted names for these functions. For historical reasons (i.e., C compatibility), you might not be able to get hold of identifiers like "cos" without them being in the global identifier space - #include <cmath> is guaranteed to give you "std::cos" but it is also possible (and likely) that you get "cos" even without any kind of "using namespace std;" or "using std::cos;". This is unfortunate, but that's part of the cost of backwards compatibility. However, it is entirely reasonable to use "std::cos", or to put a "using" declaration in the function using it. It is also entirely plausible that code could want cosine functions with different characteristics from the standard library "cos". That could include a different balance of accuracy and speed, different types, different error handling, a consteval version, etc.
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <Keith.S.Thompson+u@gmail.com> |
|---|---|
| Date | 2022-06-02 10:09 -0700 |
| Message-ID | <87leufrnz8.fsf@nosuchdomain.example.com> |
| In reply to | #84475 |
David Brown <david.brown@hesbynett.no> writes:
> On 02/06/2022 13:40, Malcolm McLean wrote:
>> On Thursday, 2 June 2022 at 09:53:22 UTC+1, Juha Nieminen wrote:
>>>
>>> I can't think of any situation where "using namespace std;" would
>>> actually introduce some benefit to the code, in terms of readability
>>> or otherwise. I can think of plenty of examples of the opposite.
>>>
>> I tend to include the C math library.
>> The reason is that my code involves a lot of complicated
>> mathematical
>> formulae. The convention is that the identifier "cos" means "take the
>> cosine". There's no broad convention for using "std::cos", "math.cos".
>> or even "cosine".
>> Also, the convention is that a formula is one expression. Breaking it
>> up over several lines makes it harder rather than easier to read.
>> So you've got long complicated expressions with calls to common
>> functions embedded in them. It's clearly better to be able to use the
>> accepted names for these functions.
>
> For historical reasons (i.e., C compatibility), you might not be able
> to get hold of identifiers like "cos" without them being in the global
> identifier space - #include <cmath> is guaranteed to give you
> "std::cos" but it is also possible (and likely) that you get "cos"
> even without any kind of "using namespace std;" or "using std::cos;".
>
> This is unfortunate, but that's part of the cost of backwards compatibility.
>
> However, it is entirely reasonable to use "std::cos", or to put a
> "using" declaration in the function using it. It is also entirely
> plausible that code could want cosine functions with different
> characteristics from the standard library "cos". That could include a
> different balance of accuracy and speed, different types, different
> error handling, a consteval version, etc.
Math functions are a case where it might make more sense to want to use
the bare names. I personally would prefer `std::cos`, but if you want
to use bare names only for the math functions, you can import them
individually:
using std::sin;
using std::cos;
or, starting in C++17:
using std::sin, std::cos;
I personally would prefer this over `using namespace std;`.
(The names "sin", "cos", "sqrt" et all are not likely to collide with
anything, but "log" is another matter.)
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */
[toc] | [prev] | [next] | [standalone]
| From | David Brown <david.brown@hesbynett.no> |
|---|---|
| Date | 2022-06-02 22:35 +0200 |
| Message-ID | <t7b6to$nn8$1@dont-email.me> |
| In reply to | #84478 |
On 02/06/2022 19:09, Keith Thompson wrote: > David Brown <david.brown@hesbynett.no> writes: >> On 02/06/2022 13:40, Malcolm McLean wrote: >>> On Thursday, 2 June 2022 at 09:53:22 UTC+1, Juha Nieminen wrote: >>>> >>>> I can't think of any situation where "using namespace std;" would >>>> actually introduce some benefit to the code, in terms of readability >>>> or otherwise. I can think of plenty of examples of the opposite. >>>> >>> I tend to include the C math library. >>> The reason is that my code involves a lot of complicated >>> mathematical >>> formulae. The convention is that the identifier "cos" means "take the >>> cosine". There's no broad convention for using "std::cos", "math.cos". >>> or even "cosine". >>> Also, the convention is that a formula is one expression. Breaking it >>> up over several lines makes it harder rather than easier to read. >>> So you've got long complicated expressions with calls to common >>> functions embedded in them. It's clearly better to be able to use the >>> accepted names for these functions. >> >> For historical reasons (i.e., C compatibility), you might not be able >> to get hold of identifiers like "cos" without them being in the global >> identifier space - #include <cmath> is guaranteed to give you >> "std::cos" but it is also possible (and likely) that you get "cos" >> even without any kind of "using namespace std;" or "using std::cos;". >> >> This is unfortunate, but that's part of the cost of backwards compatibility. >> >> However, it is entirely reasonable to use "std::cos", or to put a >> "using" declaration in the function using it. It is also entirely >> plausible that code could want cosine functions with different >> characteristics from the standard library "cos". That could include a >> different balance of accuracy and speed, different types, different >> error handling, a consteval version, etc. > > Math functions are a case where it might make more sense to want to use > the bare names. I personally would prefer `std::cos`, but if you want > to use bare names only for the math functions, you can import them > individually: > using std::sin; > using std::cos; > or, starting in C++17: > using std::sin, std::cos; > I personally would prefer this over `using namespace std;`. > Yes, these are all possible. At the very least, "using namespace std;" can be put locally in a small function for much lower risk than having it apply to the whole file. > (The names "sin", "cos", "sqrt" et all are not likely to collide with > anything, but "log" is another matter.) > When I have implemented my own cos and sin functions (typically for higher speed, lower accuracy versions in embedded systems), I would have liked to call them "cos" and "sin". I usually go for "cosine" and "sine" - in most cases the code in question has been in C or at least C compatible, ruling out namespaces. (Of course "log" is more likely to have conflicts.)
[toc] | [prev] | [next] | [standalone]
| From | Juha Nieminen <nospam@thanks.invalid> |
|---|---|
| Date | 2022-06-03 04:22 +0000 |
| Message-ID | <t7c2af$1fft$1@gioia.aioe.org> |
| In reply to | #84482 |
David Brown <david.brown@hesbynett.no> wrote: > When I have implemented my own cos and sin functions (typically for > higher speed, lower accuracy versions in embedded systems), I would have > liked to call them "cos" and "sin". I usually go for "cosine" and > "sine" - in most cases the code in question has been in C or at least C > compatible, ruling out namespaces. In such a case it might actually be a good idea to use a different name for such functions, to more clearly indicate their nature, eg. in this case that they may be less accurate. Perhaps something like fastsin(), fastcos(), etc. (I don't think math expressions in code need to look *exactly* like on paper. Which they already don't; after all, people rarely use the asterisk to indicate multiplication when writing math on paper.)
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2022-06-03 06:23 +0200 |
| Message-ID | <t7c2bu$3u9$1@dont-email.me> |
| In reply to | #84487 |
Am 03.06.2022 um 06:22 schrieb Juha Nieminen: > David Brown <david.brown@hesbynett.no> wrote: >> When I have implemented my own cos and sin functions (typically for >> higher speed, lower accuracy versions in embedded systems), I would have >> liked to call them "cos" and "sin". I usually go for "cosine" and >> "sine" - in most cases the code in question has been in C or at least C >> compatible, ruling out namespaces. > > In such a case it might actually be a good idea to use a different name > for such functions, to more clearly indicate their nature, eg. in this case > that they may be less accurate. Perhaps something like fastsin(), fastcos(), > etc. Such programmers are always standing with one feet on the other feet. ;-)
[toc] | [prev] | [next] | [standalone]
| From | Juha Nieminen <nospam@thanks.invalid> |
|---|---|
| Date | 2022-06-03 04:28 +0000 |
| Message-ID | <t7c2m9$1fft$5@gioia.aioe.org> |
| In reply to | #84488 |
Bonita Montero <Bonita.Montero@gmail.com> wrote: > Am 03.06.2022 um 06:22 schrieb Juha Nieminen: >> David Brown <david.brown@hesbynett.no> wrote: >>> When I have implemented my own cos and sin functions (typically for >>> higher speed, lower accuracy versions in embedded systems), I would have >>> liked to call them "cos" and "sin". I usually go for "cosine" and >>> "sine" - in most cases the code in question has been in C or at least C >>> compatible, ruling out namespaces. >> >> In such a case it might actually be a good idea to use a different name >> for such functions, to more clearly indicate their nature, eg. in this case >> that they may be less accurate. Perhaps something like fastsin(), fastcos(), >> etc. > > Such programmers are always standing with one feet on the other feet. > ;-) Oh, so now you are pretty much effectively "stalking" me here, responding something stupid to everything I write, even when I was responding to someone else entirely? Talk about being obsessed. Well, you do you.
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2022-06-03 06:35 +0200 |
| Message-ID | <t7c32d$7rb$1@dont-email.me> |
| In reply to | #84492 |
Am 03.06.2022 um 06:28 schrieb Juha Nieminen: > Bonita Montero <Bonita.Montero@gmail.com> wrote: >> Am 03.06.2022 um 06:22 schrieb Juha Nieminen: >>> David Brown <david.brown@hesbynett.no> wrote: >>>> When I have implemented my own cos and sin functions (typically for >>>> higher speed, lower accuracy versions in embedded systems), I would have >>>> liked to call them "cos" and "sin". I usually go for "cosine" and >>>> "sine" - in most cases the code in question has been in C or at least C >>>> compatible, ruling out namespaces. >>> >>> In such a case it might actually be a good idea to use a different name >>> for such functions, to more clearly indicate their nature, eg. in this case >>> that they may be less accurate. Perhaps something like fastsin(), fastcos(), >>> etc. >> >> Such programmers are always standing with one feet on the other feet. >> ;-) > > Oh, so now you are pretty much effectively "stalking" me here, responding > something stupid to everything I write, even when I was responding to > someone else entirely? It's not as important to me as someone who stalks, I just want to ridicule you a little.
[toc] | [prev] | [next] | [standalone]
| From | Juha Nieminen <nospam@thanks.invalid> |
|---|---|
| Date | 2022-06-03 05:22 +0000 |
| Message-ID | <t7c5qu$dob$1@gioia.aioe.org> |
| In reply to | #84493 |
Bonita Montero <Bonita.Montero@gmail.com> wrote: > I just want to ridicule you a little. And that's the crux of it, isn't it? Well, don't expect any more respect from me in the future.
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2022-06-03 07:23 +0200 |
| Message-ID | <t7c5sa$ovh$1@dont-email.me> |
| In reply to | #84494 |
Am 03.06.2022 um 07:22 schrieb Juha Nieminen: > Bonita Montero <Bonita.Montero@gmail.com> wrote: >> I just want to ridicule you a little. > > And that's the crux of it, isn't it? > > Well, don't expect any more respect from me in the future. You never have shown respect, so this isn't a proble for me. ;-)
[toc] | [prev] | [next] | [standalone]
| From | "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> |
|---|---|
| Date | 2022-06-02 22:25 -0700 |
| Message-ID | <t7c5vv$pd8$1@dont-email.me> |
| In reply to | #84495 |
On 6/2/2022 10:23 PM, Bonita Montero wrote: > Am 03.06.2022 um 07:22 schrieb Juha Nieminen: >> Bonita Montero <Bonita.Montero@gmail.com> wrote: >>> I just want to ridicule you a little. >> >> And that's the crux of it, isn't it? >> >> Well, don't expect any more respect from me in the future. > > You never have shown respect, so this isn't a proble for me. > ;-) Puke! I have tried to tolerate you in the past. Actually, it resulted in some interesting content. ;^)
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2022-06-03 07:28 +0200 |
| Message-ID | <t7c663$qii$1@dont-email.me> |
| In reply to | #84496 |
Am 03.06.2022 um 07:25 schrieb Chris M. Thomasson: > On 6/2/2022 10:23 PM, Bonita Montero wrote: >> Am 03.06.2022 um 07:22 schrieb Juha Nieminen: >>> Bonita Montero <Bonita.Montero@gmail.com> wrote: >>>> I just want to ridicule you a little. >>> >>> And that's the crux of it, isn't it? >>> >>> Well, don't expect any more respect from me in the future. >> >> You never have shown respect, so this isn't a proble for me. >> ;-) > > Puke! I have tried to tolerate you in the past. ... This was addressed to Juha.
[toc] | [prev] | [next] | [standalone]
| From | "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> |
|---|---|
| Date | 2022-06-02 22:31 -0700 |
| Message-ID | <t7c6cd$rsa$1@dont-email.me> |
| In reply to | #84497 |
On 6/2/2022 10:28 PM, Bonita Montero wrote: > Am 03.06.2022 um 07:25 schrieb Chris M. Thomasson: >> On 6/2/2022 10:23 PM, Bonita Montero wrote: >>> Am 03.06.2022 um 07:22 schrieb Juha Nieminen: >>>> Bonita Montero <Bonita.Montero@gmail.com> wrote: >>>>> I just want to ridicule you a little. >>>> >>>> And that's the crux of it, isn't it? >>>> >>>> Well, don't expect any more respect from me in the future. >>> >>> You never have shown respect, so this isn't a proble for me. >>> ;-) >> >> Puke! I have tried to tolerate you in the past. ... > > This was addressed to Juha. > Touche. Sorry for butting in.
[toc] | [prev] | [next] | [standalone]
| From | Juha Nieminen <nospam@thanks.invalid> |
|---|---|
| Date | 2022-06-03 06:22 +0000 |
| Message-ID | <t7c9ag$1ftp$1@gioia.aioe.org> |
| In reply to | #84498 |
Chris M. Thomasson <chris.m.thomasson.1@gmail.com> wrote: > On 6/2/2022 10:28 PM, Bonita Montero wrote: >> Am 03.06.2022 um 07:25 schrieb Chris M. Thomasson: >>> On 6/2/2022 10:23 PM, Bonita Montero wrote: >>>> Am 03.06.2022 um 07:22 schrieb Juha Nieminen: >>>>> Bonita Montero <Bonita.Montero@gmail.com> wrote: >>>>>> I just want to ridicule you a little. >>>>> >>>>> And that's the crux of it, isn't it? >>>>> >>>>> Well, don't expect any more respect from me in the future. >>>> >>>> You never have shown respect, so this isn't a proble for me. >>>> ;-) >>> >>> Puke! I have tried to tolerate you in the past. ... >> >> This was addressed to Juha. >> > Touche. Sorry for butting in. Yeah, she seems to have a crush on me, so don't get in the way. We don't need a third wheel.
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2022-06-03 08:38 +0200 |
| Message-ID | <t7ca8g$jqb$1@dont-email.me> |
| In reply to | #84499 |
Am 03.06.2022 um 08:22 schrieb Juha Nieminen: > Chris M. Thomasson <chris.m.thomasson.1@gmail.com> wrote: >> On 6/2/2022 10:28 PM, Bonita Montero wrote: >>> Am 03.06.2022 um 07:25 schrieb Chris M. Thomasson: >>>> On 6/2/2022 10:23 PM, Bonita Montero wrote: >>>>> Am 03.06.2022 um 07:22 schrieb Juha Nieminen: >>>>>> Bonita Montero <Bonita.Montero@gmail.com> wrote: >>>>>>> I just want to ridicule you a little. >>>>>> >>>>>> And that's the crux of it, isn't it? >>>>>> >>>>>> Well, don't expect any more respect from me in the future. >>>>> >>>>> You never have shown respect, so this isn't a proble for me. >>>>> ;-) >>>> >>>> Puke! I have tried to tolerate you in the past. ... >>> >>> This was addressed to Juha. >>> >> Touche. Sorry for butting in. > > Yeah, she seems to have a crush on me, so don't get in the way. > We don't need a third wheel. I don't have a crush on you, I just want to disable you to make forcefull "recommedations".
[toc] | [prev] | [next] | [standalone]
| From | Juha Nieminen <nospam@thanks.invalid> |
|---|---|
| Date | 2022-06-03 10:14 +0000 |
| Message-ID | <t7cmur$1ijn$1@gioia.aioe.org> |
| In reply to | #84500 |
Bonita Montero <Bonita.Montero@gmail.com> wrote: > Am 03.06.2022 um 08:22 schrieb Juha Nieminen: >> Chris M. Thomasson <chris.m.thomasson.1@gmail.com> wrote: >>> On 6/2/2022 10:28 PM, Bonita Montero wrote: >>>> Am 03.06.2022 um 07:25 schrieb Chris M. Thomasson: >>>>> On 6/2/2022 10:23 PM, Bonita Montero wrote: >>>>>> Am 03.06.2022 um 07:22 schrieb Juha Nieminen: >>>>>>> Bonita Montero <Bonita.Montero@gmail.com> wrote: >>>>>>>> I just want to ridicule you a little. >>>>>>> >>>>>>> And that's the crux of it, isn't it? >>>>>>> >>>>>>> Well, don't expect any more respect from me in the future. >>>>>> >>>>>> You never have shown respect, so this isn't a proble for me. >>>>>> ;-) >>>>> >>>>> Puke! I have tried to tolerate you in the past. ... >>>> >>>> This was addressed to Juha. >>>> >>> Touche. Sorry for butting in. >> >> Yeah, she seems to have a crush on me, so don't get in the way. >> We don't need a third wheel. > > I don't have a crush on you, I just want to disable you > to make forcefull "recommedations". No need to be shy about it.
[toc] | [prev] | [next] | [standalone]
| From | "daniel...@gmail.com" <danielaparker@gmail.com> |
|---|---|
| Date | 2022-06-03 06:32 -0700 |
| Message-ID | <f1f87297-7d1f-457d-857e-726b381bbaf4n@googlegroups.com> |
| In reply to | #84496 |
On Friday, June 3, 2022 at 1:25:35 AM UTC-4, Chris M. Thomasson wrote: > On 6/2/2022 10:23 PM, Bonita Montero wrote: >> > I have tried to tolerate you in the past. I hope you continue to do so :-) We rely on your example for how to communicate in a civilized and respectful fashion, that is more helpful to the group than the stern lectures verging on the chauvinistic. > Actually, it resulted in some interesting content. ;^) It did, did result in interesting content. Certainly more interesting than obsessing over "using namespace std" above 166 lines of code. Best regards, Daniel
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2022-06-03 15:35 +0200 |
| Message-ID | <t7d2m3$7bq$2@dont-email.me> |
| In reply to | #84504 |
> I hope you continue to do so :-) We rely on your example for how > to communicate in a civilized and respectful fashion, that is > more helpful to the group than the stern lectures verging on > the chauvinistic. Is dictating others their taste civilized ?
[toc] | [prev] | [next] | [standalone]
| From | "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> |
|---|---|
| Date | 2022-06-03 14:12 -0700 |
| Message-ID | <t7dtf3$5k4$1@dont-email.me> |
| In reply to | #84504 |
On 6/3/2022 6:32 AM, daniel...@gmail.com wrote: > On Friday, June 3, 2022 at 1:25:35 AM UTC-4, Chris M. Thomasson wrote: >> On 6/2/2022 10:23 PM, Bonita Montero wrote: > >>> > >> I have tried to tolerate you in the past. > > I hope you continue to do so :-) We rely on your example for how > to communicate in a civilized and respectful fashion, that is > more helpful to the group than the stern lectures verging on > the chauvinistic. Thank you Daniel. We never really got into an all out "Flame War". I went over the line a bit a couple of times, but was able to break out of it. Bonita is an interesting entity. >> Actually, it resulted in some interesting content. ;^) > > It did, did result in interesting content. Certainly more > interesting than obsessing over "using namespace std" > above 166 lines of code. Indeed! We got into some deep conversations about multi-threading, memory barriers, exotic lock/wait free algorithms... All of that fun stuff! :^)
[toc] | [prev] | [next] | [standalone]
Page 5 of 8 — ← Prev page 1 2 3 4 [5] 6 7 8 Next page →
Back to top | Article view | comp.lang.c++
csiph-web