Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Houston, Tranquillity Base here. The Eagle has landed. -- Neil Armstrong


devel / comp.lang.c / Re: eficient float sign routine

SubjectAuthor
* eficient float sign routinefir
+* Re: eficient float sign routineBen
|+* Re: eficient float sign routinefir
||`* Re: eficient float sign routinefir
|| `* Re: eficient float sign routinefir
||  +- Re: eficient float sign routinefir
||  `* Re: eficient float sign routineBen
||   `* Re: eficient float sign routinefir
||    `- Re: eficient float sign routinefir
|`* Re: eficient float sign routineTim Rentsch
| +* Re: eficient float sign routinefir
| |`* Re: eficient float sign routinefir
| | `* Re: eficient float sign routinefir
| |  `- Re: eficient float sign routinefir
| `- Re: eficient float sign routineBen
+* Re: eficient float sign routineAndrey Tarasevich
|+* Re: eficient float sign routineRichard Damon
||`- Re: eficient float sign routineAndrey Tarasevich
|`* Re: eficient float sign routinefir
| `* Re: eficient float sign routinefir
|  `* Re: eficient float sign routinefir
|   `* Re: eficient float sign routinefir
|    `- Re: eficient float sign routinefir
`* Re: eficient float sign routineBonita Montero
 +* Re: eficient float sign routineBonita Montero
 |+* Re: eficient float sign routineBonita Montero
 ||`* Re: eficient float sign routineKaz Kylheku
 || `* Re: eficient float sign routineBonita Montero
 ||  `* Re: eficient float sign routineÖö Tiib
 ||   `* Re: eficient float sign routineBonita Montero
 ||    `* Re: eficient float sign routinefir
 ||     `- Re: eficient float sign routineBonita Montero
 |`* Re: eficient float sign routinefir
 | `* Re: eficient float sign routineBonita Montero
 |  `* Re: eficient float sign routinefir
 |   +* Re: eficient float sign routinefir
 |   |+* Re: eficient float sign routinefir
 |   ||`* Re: eficient float sign routineBonita Montero
 |   || `- Re: eficient float sign routinefir
 |   |+* Re: eficient float sign routineBonita Montero
 |   ||`- Re: eficient float sign routinefir
 |   |`* Re: eficient float sign routinefir
 |   | +- Re: eficient float sign routinefir
 |   | +* Re: eficient float sign routinefir
 |   | |`* Re: eficient float sign routinefir
 |   | | `- Re: eficient float sign routinefir
 |   | `* Re: eficient float sign routineBonita Montero
 |   |  `* Re: eficient float sign routinefir
 |   |   `- Re: eficient float sign routinefir
 |   `- Re: eficient float sign routineBonita Montero
 `* Re: eficient float sign routineScott Lurndal
  +* Re: eficient float sign routineManfred
  |`* Re: eficient float sign routineBen
  | +* Re: eficient float sign routineKeith Thompson
  | |`- Re: eficient float sign routineBen
  | `* Re: eficient float sign routineManfred
  |  `* Re: eficient float sign routineTim Rentsch
  |   `* Re: eficient float sign routinejak
  |    `* Re: eficient float sign routineTim Rentsch
  |     `* Re: eficient float sign routinejak
  |      `* Re: eficient float sign routineTim Rentsch
  |       `* Re: eficient float sign routinejak
  |        `* Re: eficient float sign routineBen
  |         `- Re: eficient float sign routinejak
  `- Re: eficient float sign routineBonita Montero

Pages:123
Re: eficient float sign routine

<t6uegs$qh3$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21762&group=comp.lang.c#21762

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: eficient float sign routine
Date: Sun, 29 May 2022 02:25:12 +0200
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <t6uegs$qh3$1@dont-email.me>
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <wXukK.37418$J0r9.3724@fx11.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 29 May 2022 00:25:00 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="617106b4ae0eb2c50f972941a2ba0003";
logging-data="27171"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/0CoYX81/jeXOx4PfwBoGQExDVBvoPzOk="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:JyZwXycfbRTtkBlBw3juYZjugO8=
In-Reply-To: <wXukK.37418$J0r9.3724@fx11.iad>
Content-Language: de-DE
 by: Bonita Montero - Sun, 29 May 2022 00:25 UTC

Am 28.05.2022 um 21:43 schrieb Scott Lurndal:
> Bonita Montero <Bonita.Montero@gmail.com> writes:
>> In a superior language:
>>
>> #include <cstdint>
>> #include <cstring>
>> #include <limits>
>> #include <concepts>
>> #include <type_traits>
>>
>> template<typename FpType>
>> requires (std::same_as<FpType, float> || std::same_as<FpType, double>)
>> && std::numeric_limits<FpType>::is_iec559
>> std::conditional_t<std::same_as<FpType, float>, std::int32_t,
>> std::int64_t> giveSign( FpType value )
>> {
>> using namespace std;
>> conditional_t<std::same_as<FpType, float>, int32_t, int64_t> iValue;
>> memcpy( &iValue, &value, sizeof value );
>> return iValue;
>> }
>>
>> template
>> std::int32_t giveSign( float );
>>
>>
>> template
>> std::int64_t giveSign( double );
>
> In an even more superior language.
>
> #include <math.h>
>
> int main()
> {
> float_t number = -1.235;
>
> sign = signbit(number);
> return sign;
> }

My second implementation does more than that
but gives a -1, 0 or 1 result.

Re: eficient float sign routine

<87pmjxru6a.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21763&group=comp.lang.c#21763

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: eficient float sign routine
Date: Sat, 28 May 2022 18:42:21 -0700
Organization: None to speak of
Lines: 22
Message-ID: <87pmjxru6a.fsf@nosuchdomain.example.com>
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <wXukK.37418$J0r9.3724@fx11.iad>
<t6u21o$pje$1@gioia.aioe.org> <877d65w6jp.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="96dc7f6d889009ac755351dbb15bda06";
logging-data="14883"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX197sqPGmHYKPzQxe20kcPkp"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:JNCBIZ+9dp85zXRQKdG5eigPN6s=
sha1:D4r8G9xx/ZpP1JwNPaSpq5LVstw=
 by: Keith Thompson - Sun, 29 May 2022 01:42 UTC

Ben <ben.usenet@bsb.me.uk> writes:
[...]
> Yes, missing type but also
>
> int sign = signbitf(number);
>
> if likely to be what's wanted, even though float_t is not a standard
> type. Anyway, the point stands that simpler solutions are often
> preferable.

Yes, float_t is standard. It's the same as one of the predefined
floating-point types, depending on the value of FLT_EVAL_METHOD.

And there is no signbitf in the standard. signbit() is a macro that
takes an argument of any real floating type.

float_t and signbit() are defined in <math.h>, introduced in C99.

--
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 */

Re: eficient float sign routine

<t6uvk0$nm6$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21764&group=comp.lang.c#21764

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: eficient float sign routine
Date: Sun, 29 May 2022 07:16:59 +0200
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <t6uvk0$nm6$1@dont-email.me>
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 29 May 2022 05:16:48 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="617106b4ae0eb2c50f972941a2ba0003";
logging-data="24262"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/QVVxFk17rur5OAlJY/o88UHhlSv9pdx4="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:0L75mhioiNMRaw95/jimK5U0xDU=
In-Reply-To: <t6tnb4$fe1$1@dont-email.me>
Content-Language: de-DE
 by: Bonita Montero - Sun, 29 May 2022 05:16 UTC

Even simpler:

#include <cstdint>
#include <cstring>
#include <limits>
#include <concepts>
#include <type_traits>

template<typename FpType>
requires (sizeof(FpType) == 4 || sizeof(FpType) == 8) &&
std::numeric_limits<FpType>::is_iec559
int giveSign( FpType value )
{ using namespace std;
conditional_t<sizeof(FpType) == 4, int32_t, int64_t> iValue;
memcpy( &iValue, &value, sizeof value );
return (int)(iValue > 0) - (int)(iValue < 0);
}

template
int giveSign( float );

template
int giveSign( double );

Now two floating point types are supported that must be four
or eight bytes. They don't have to be float and double.

Re: eficient float sign routine

<20220528225109.542@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21765&group=comp.lang.c#21765

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: 480-992-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: eficient float sign routine
Date: Sun, 29 May 2022 05:52:14 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <20220528225109.542@kylheku.com>
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me>
<t6uvk0$nm6$1@dont-email.me>
Injection-Date: Sun, 29 May 2022 05:52:14 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="caec2525927c55d4e2b96131dd040382";
logging-data="17638"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Ya6uO4ZwLVq5lPFOLyjPntaYz+1ZhhP8="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:QhF3rNZF4XM3bVeOtVF0ezhgHpY=
 by: Kaz Kylheku - Sun, 29 May 2022 05:52 UTC

On 2022-05-29, Bonita Montero <Bonita.Montero@gmail.com> wrote:
> Even simpler:
>
> #include <cstdint>
> #include <cstring>
> #include <limits>
> #include <concepts>
> #include <type_traits>
>
> template<typename FpType>
> requires (sizeof(FpType) == 4 || sizeof(FpType) == 8) &&
> std::numeric_limits<FpType>::is_iec559
> int giveSign( FpType value )
> {
> using namespace std;
> conditional_t<sizeof(FpType) == 4, int32_t, int64_t> iValue;
> memcpy( &iValue, &value, sizeof value );
> return (int)(iValue > 0) - (int)(iValue < 0);
> }
>
> template
> int giveSign( float );
>
> template
> int giveSign( double );
>
> Now two floating point types are supported that must be four
> or eight bytes. They don't have to be float and double.

Problem is, you have to get parliament to vote on this lengthy
and controversial bill, and then get it past the senate.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal

Re: eficient float sign routine

<t6v48i$v7f$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21766&group=comp.lang.c#21766

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: eficient float sign routine
Date: Sun, 29 May 2022 08:36:13 +0200
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <t6v48i$v7f$2@dont-email.me>
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me>
<t6uvk0$nm6$1@dont-email.me> <20220528225109.542@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 29 May 2022 06:36:02 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="617106b4ae0eb2c50f972941a2ba0003";
logging-data="31983"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18kTp6S8p6rUvjKj53cfShkvgkrBlcsmlI="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:/CGDxh7WufXOuPcv2pussbftHTw=
In-Reply-To: <20220528225109.542@kylheku.com>
Content-Language: de-DE
 by: Bonita Montero - Sun, 29 May 2022 06:36 UTC

Am 29.05.2022 um 07:52 schrieb Kaz Kylheku:
> On 2022-05-29, Bonita Montero <Bonita.Montero@gmail.com> wrote:
>> Even simpler:
>>
>> #include <cstdint>
>> #include <cstring>
>> #include <limits>
>> #include <concepts>
>> #include <type_traits>
>>
>> template<typename FpType>
>> requires (sizeof(FpType) == 4 || sizeof(FpType) == 8) &&
>> std::numeric_limits<FpType>::is_iec559
>> int giveSign( FpType value )
>> {
>> using namespace std;
>> conditional_t<sizeof(FpType) == 4, int32_t, int64_t> iValue;
>> memcpy( &iValue, &value, sizeof value );
>> return (int)(iValue > 0) - (int)(iValue < 0);
>> }
>>
>> template
>> int giveSign( float );
>>
>> template
>> int giveSign( double );
>>
>> Now two floating point types are supported that must be four
>> or eight bytes. They don't have to be float and double.
>
> Problem is, you have to get parliament to vote on this lengthy
> and controversial bill, and then get it past the senate.

People with such trippy phantasies like you are usually
mentally disordered.

Re: eficient float sign routine

<a8d6b239-f31f-42bc-b223-f1f952ace5c7n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21770&group=comp.lang.c#21770

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:1714:b0:2f3:e638:84a1 with SMTP id h20-20020a05622a171400b002f3e63884a1mr38902960qtk.268.1653813430310;
Sun, 29 May 2022 01:37:10 -0700 (PDT)
X-Received: by 2002:a37:27c8:0:b0:6a3:d5c1:1969 with SMTP id
n191-20020a3727c8000000b006a3d5c11969mr20307673qkn.630.1653813430171; Sun, 29
May 2022 01:37:10 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 29 May 2022 01:37:10 -0700 (PDT)
In-Reply-To: <t6v48i$v7f$2@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=145.14.19.246; posting-account=pysjKgkAAACLegAdYDFznkqjgx_7vlUK
NNTP-Posting-Host: 145.14.19.246
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me> <t6uvk0$nm6$1@dont-email.me>
<20220528225109.542@kylheku.com> <t6v48i$v7f$2@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a8d6b239-f31f-42bc-b223-f1f952ace5c7n@googlegroups.com>
Subject: Re: eficient float sign routine
From: oot...@hot.ee (Öö Tiib)
Injection-Date: Sun, 29 May 2022 08:37:10 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Öö Tiib - Sun, 29 May 2022 08:37 UTC

On Sunday, 29 May 2022 at 09:36:15 UTC+3, Bonita Montero wrote:
> People with such trippy phantasies like you are usually
> mentally disordered.

Stop mirroring your health issues to others, it looks sad.

Re: eficient float sign routine

<t6vbds$6pe$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21771&group=comp.lang.c#21771

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: eficient float sign routine
Date: Sun, 29 May 2022 10:38:30 +0200
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <t6vbds$6pe$2@dont-email.me>
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me>
<t6uvk0$nm6$1@dont-email.me> <20220528225109.542@kylheku.com>
<t6v48i$v7f$2@dont-email.me>
<a8d6b239-f31f-42bc-b223-f1f952ace5c7n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 29 May 2022 08:38:20 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="617106b4ae0eb2c50f972941a2ba0003";
logging-data="6958"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19tvI8C11FiayWV+KYOdjxoZWS2L+KIpIA="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:A5CSYecJSlf1cFGXtdFMtmNlpkM=
In-Reply-To: <a8d6b239-f31f-42bc-b223-f1f952ace5c7n@googlegroups.com>
Content-Language: de-DE
 by: Bonita Montero - Sun, 29 May 2022 08:38 UTC

Am 29.05.2022 um 10:37 schrieb Öö Tiib:
> On Sunday, 29 May 2022 at 09:36:15 UTC+3, Bonita Montero wrote:
>> People with such trippy phantasies like you are usually
>> mentally disordered.
>
> Stop mirroring your health issues to others, it looks sad.

I'm not the one with such phantasies.

Re: eficient float sign routine

<305c3828-40ee-4358-b5b0-25198f159f98n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21772&group=comp.lang.c#21772

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:23c9:b0:461:c9e7:9cd6 with SMTP id hr9-20020a05621423c900b00461c9e79cd6mr41200788qvb.116.1653816988013;
Sun, 29 May 2022 02:36:28 -0700 (PDT)
X-Received: by 2002:a05:620a:f0d:b0:67e:1c14:bc5e with SMTP id
v13-20020a05620a0f0d00b0067e1c14bc5emr33789139qkl.502.1653816987826; Sun, 29
May 2022 02:36:27 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 29 May 2022 02:36:27 -0700 (PDT)
In-Reply-To: <t6vbds$6pe$2@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.215; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.215
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me> <t6uvk0$nm6$1@dont-email.me>
<20220528225109.542@kylheku.com> <t6v48i$v7f$2@dont-email.me>
<a8d6b239-f31f-42bc-b223-f1f952ace5c7n@googlegroups.com> <t6vbds$6pe$2@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <305c3828-40ee-4358-b5b0-25198f159f98n@googlegroups.com>
Subject: Re: eficient float sign routine
From: profesor...@gmail.com (fir)
Injection-Date: Sun, 29 May 2022 09:36:28 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2106
 by: fir - Sun, 29 May 2022 09:36 UTC

niedziela, 29 maja 2022 o 10:38:33 UTC+2 Bonita Montero napisał(a):
> Am 29.05.2022 um 10:37 schrieb Öö Tiib:
> > On Sunday, 29 May 2022 at 09:36:15 UTC+3, Bonita Montero wrote:
> >> People with such trippy phantasies like you are usually
> >> mentally disordered.
> >
> > Stop mirroring your health issues to others, it looks sad.
> I'm not the one with such phantasies.

youre religious fanatic bonita and this is not lookin healthy

for example i know that c is unparralably better than c++ but i dont feel a religious need to
fight on it in hundreds of posts... you do fight for c++ like hodgin for christ and that
is kinda sick.. such war fanatism is not healthly

Re: eficient float sign routine

<558d49fa-47aa-4b13-b5c4-937ce8dd8c6bn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21773&group=comp.lang.c#21773

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:d87:b0:67b:311c:ecbd with SMTP id q7-20020a05620a0d8700b0067b311cecbdmr34039505qkl.146.1653817234017;
Sun, 29 May 2022 02:40:34 -0700 (PDT)
X-Received: by 2002:a05:6214:2a88:b0:464:463a:7a7c with SMTP id
jr8-20020a0562142a8800b00464463a7a7cmr2951613qvb.127.1653817233791; Sun, 29
May 2022 02:40:33 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 29 May 2022 02:40:33 -0700 (PDT)
In-Reply-To: <t6tnb4$fe1$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.215; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.215
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <558d49fa-47aa-4b13-b5c4-937ce8dd8c6bn@googlegroups.com>
Subject: Re: eficient float sign routine
From: profesor...@gmail.com (fir)
Injection-Date: Sun, 29 May 2022 09:40:34 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2651
 by: fir - Sun, 29 May 2022 09:40 UTC

sobota, 28 maja 2022 o 19:49:38 UTC+2 Bonita Montero napisał(a):
> Sorry, litle mistake:
> #include <cstdint>
> #include <cstring>
> #include <limits>
> #include <concepts>
> #include <type_traits>
>
> template<typename FpType>
> requires (std::same_as<FpType, float> || std::same_as<FpType, double>)
> && std::numeric_limits<FpType>::is_iec559
> int giveSign( FpType value )
> {
> using namespace std;
> conditional_t<same_as<FpType, float>, int32_t, int64_t> iValue;
> memcpy( &iValue, &value, sizeof value );
> return (iValue > 0) - (iValue < 0);
> }
>
> template
> int giveSign( float );
>
> template
> int giveSign( double );
> Gives:
>
> "??$giveSign@M@@YAHM@Z":
> movd eax, xmm0
> xor ecx, ecx
> test eax, eax
> setg cl
> sar eax, 31
> add eax, ecx
> ret
>
> "??$giveSign@N@@YAHN@Z":
> movq rax, xmm0
> xor ecx, ecx
> test rax, rax
> setg cl
> sar rax, 63
> add eax, ecx
>
> Compiler: clang-cl 13.

only this assembly is interesting for me ..still for a such thing as sign it seem a
long assembly

as i said teh oryginal problem is to count

float d = sqrt(dx*dx + dy*dy + dz*dz);
float dd = (d - link_dist);
float p = -sign(dd)*dd*dd* joint_hardness;

as fast as it can, and puttiung this couple of instructions to sole sign seems
a bit of overhead

Re: eficient float sign routine

<t6vftl$dc$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21774&group=comp.lang.c#21774

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: eficient float sign routine
Date: Sun, 29 May 2022 11:55:11 +0200
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <t6vftl$dc$1@dont-email.me>
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me>
<t6uvk0$nm6$1@dont-email.me> <20220528225109.542@kylheku.com>
<t6v48i$v7f$2@dont-email.me>
<a8d6b239-f31f-42bc-b223-f1f952ace5c7n@googlegroups.com>
<t6vbds$6pe$2@dont-email.me>
<305c3828-40ee-4358-b5b0-25198f159f98n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 29 May 2022 09:55:01 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="617106b4ae0eb2c50f972941a2ba0003";
logging-data="428"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/voL8Z4vNuaODBfo4vWg+/HNR5Fg8aucc="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:p5mRafoLVLlD0Wu4Rmntgbv+erQ=
In-Reply-To: <305c3828-40ee-4358-b5b0-25198f159f98n@googlegroups.com>
Content-Language: de-DE
 by: Bonita Montero - Sun, 29 May 2022 09:55 UTC

Am 29.05.2022 um 11:36 schrieb fir:
> niedziela, 29 maja 2022 o 10:38:33 UTC+2 Bonita Montero napisał(a):
>> Am 29.05.2022 um 10:37 schrieb Öö Tiib:
>>> On Sunday, 29 May 2022 at 09:36:15 UTC+3, Bonita Montero wrote:
>>>> People with such trippy phantasies like you are usually
>>>> mentally disordered.
>>>
>>> Stop mirroring your health issues to others, it looks sad.
>> I'm not the one with such phantasies.
>
> youre religious fanatic bonita and this is not lookin healthy

You're the ulta-nerd, not me.

> for example i know that c is unparralably better than c++ ...

Hrhr.
Rest unread.

Re: eficient float sign routine

<t6vfv8$dc$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21775&group=comp.lang.c#21775

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: eficient float sign routine
Date: Sun, 29 May 2022 11:56:02 +0200
Organization: A noiseless patient Spider
Lines: 51
Message-ID: <t6vfv8$dc$2@dont-email.me>
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me>
<558d49fa-47aa-4b13-b5c4-937ce8dd8c6bn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 29 May 2022 09:55:52 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="617106b4ae0eb2c50f972941a2ba0003";
logging-data="428"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19pduJjK8yGA8BtyDRizHrGN2Djj5r6t/A="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:I+3pS1GSh6+mOFVUjBq7sts3G1U=
In-Reply-To: <558d49fa-47aa-4b13-b5c4-937ce8dd8c6bn@googlegroups.com>
Content-Language: de-DE
 by: Bonita Montero - Sun, 29 May 2022 09:56 UTC

Am 29.05.2022 um 11:40 schrieb fir:
> sobota, 28 maja 2022 o 19:49:38 UTC+2 Bonita Montero napisał(a):
>> Sorry, litle mistake:
>> #include <cstdint>
>> #include <cstring>
>> #include <limits>
>> #include <concepts>
>> #include <type_traits>
>>
>> template<typename FpType>
>> requires (std::same_as<FpType, float> || std::same_as<FpType, double>)
>> && std::numeric_limits<FpType>::is_iec559
>> int giveSign( FpType value )
>> {
>> using namespace std;
>> conditional_t<same_as<FpType, float>, int32_t, int64_t> iValue;
>> memcpy( &iValue, &value, sizeof value );
>> return (iValue > 0) - (iValue < 0);
>> }
>>
>> template
>> int giveSign( float );
>>
>> template
>> int giveSign( double );
>> Gives:
>>
>> "??$giveSign@M@@YAHM@Z":
>> movd eax, xmm0
>> xor ecx, ecx
>> test eax, eax
>> setg cl
>> sar eax, 31
>> add eax, ecx
>> ret
>>
>> "??$giveSign@N@@YAHN@Z":
>> movq rax, xmm0
>> xor ecx, ecx
>> test rax, rax
>> setg cl
>> sar rax, 63
>> add eax, ecx
>>
>> Compiler: clang-cl 13.
>
> only this assembly is interesting for me ..still for a such thing as sign it seem a
> long assembly

Show me the according C-functions with equal performance
and their clang-assembly.

Re: eficient float sign routine

<5921d9d0-166a-4b4a-ba01-ef19995511f5n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21777&group=comp.lang.c#21777

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:20cc:b0:464:2620:6f73 with SMTP id 12-20020a05621420cc00b0046426206f73mr10374453qve.82.1653818329479;
Sun, 29 May 2022 02:58:49 -0700 (PDT)
X-Received: by 2002:a05:6214:626:b0:462:43b4:8491 with SMTP id
a6-20020a056214062600b0046243b48491mr27686721qvx.110.1653818329369; Sun, 29
May 2022 02:58:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 29 May 2022 02:58:49 -0700 (PDT)
In-Reply-To: <t6vfv8$dc$2@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.215; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.215
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me> <558d49fa-47aa-4b13-b5c4-937ce8dd8c6bn@googlegroups.com>
<t6vfv8$dc$2@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5921d9d0-166a-4b4a-ba01-ef19995511f5n@googlegroups.com>
Subject: Re: eficient float sign routine
From: profesor...@gmail.com (fir)
Injection-Date: Sun, 29 May 2022 09:58:49 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2984
 by: fir - Sun, 29 May 2022 09:58 UTC

niedziela, 29 maja 2022 o 11:56:05 UTC+2 Bonita Montero napisał(a):
> Am 29.05.2022 um 11:40 schrieb fir:
> > sobota, 28 maja 2022 o 19:49:38 UTC+2 Bonita Montero napisał(a):
> >> Sorry, litle mistake:
> >> #include <cstdint>
> >> #include <cstring>
> >> #include <limits>
> >> #include <concepts>
> >> #include <type_traits>
> >>
> >> template<typename FpType>
> >> requires (std::same_as<FpType, float> || std::same_as<FpType, double>)
> >> && std::numeric_limits<FpType>::is_iec559
> >> int giveSign( FpType value )
> >> {
> >> using namespace std;
> >> conditional_t<same_as<FpType, float>, int32_t, int64_t> iValue;
> >> memcpy( &iValue, &value, sizeof value );
> >> return (iValue > 0) - (iValue < 0);
> >> }
> >>
> >> template
> >> int giveSign( float );
> >>
> >> template
> >> int giveSign( double );
> >> Gives:
> >>
> >> "??$giveSign@M@@YAHM@Z":
> >> movd eax, xmm0
> >> xor ecx, ecx
> >> test eax, eax
> >> setg cl
> >> sar eax, 31
> >> add eax, ecx
> >> ret
> >>
> >> "??$giveSign@N@@YAHN@Z":
> >> movq rax, xmm0
> >> xor ecx, ecx
> >> test rax, rax
> >> setg cl
> >> sar rax, 63
> >> add eax, ecx
> >>
> >> Compiler: clang-cl 13.
> >
> > only this assembly is interesting for me ..still for a such thing as sign it seem a
> > long assembly
> Show me the according C-functions with equal performance
> and their clang-assembly.

why you think i need to show that - its ypour imagination you need to fight a war
proving c++ is better than c...for me its psychiatric

Re: eficient float sign routine

<c88b592d-012c-4c6c-81cc-6f0633b01a57n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21778&group=comp.lang.c#21778

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:7f41:0:b0:2fa:f70e:8d46 with SMTP id g1-20020ac87f41000000b002faf70e8d46mr17620091qtk.528.1653818894734;
Sun, 29 May 2022 03:08:14 -0700 (PDT)
X-Received: by 2002:ac8:7d91:0:b0:2f3:b85b:326d with SMTP id
c17-20020ac87d91000000b002f3b85b326dmr40187730qtd.194.1653818894516; Sun, 29
May 2022 03:08:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 29 May 2022 03:08:14 -0700 (PDT)
In-Reply-To: <5921d9d0-166a-4b4a-ba01-ef19995511f5n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.215; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.215
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me> <558d49fa-47aa-4b13-b5c4-937ce8dd8c6bn@googlegroups.com>
<t6vfv8$dc$2@dont-email.me> <5921d9d0-166a-4b4a-ba01-ef19995511f5n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c88b592d-012c-4c6c-81cc-6f0633b01a57n@googlegroups.com>
Subject: Re: eficient float sign routine
From: profesor...@gmail.com (fir)
Injection-Date: Sun, 29 May 2022 10:08:14 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4146
 by: fir - Sun, 29 May 2022 10:08 UTC

niedziela, 29 maja 2022 o 11:58:55 UTC+2 fir napisał(a):
> niedziela, 29 maja 2022 o 11:56:05 UTC+2 Bonita Montero napisał(a):
> > Am 29.05.2022 um 11:40 schrieb fir:
> > > sobota, 28 maja 2022 o 19:49:38 UTC+2 Bonita Montero napisał(a):
> > >> Sorry, litle mistake:
> > >> #include <cstdint>
> > >> #include <cstring>
> > >> #include <limits>
> > >> #include <concepts>
> > >> #include <type_traits>
> > >>
> > >> template<typename FpType>
> > >> requires (std::same_as<FpType, float> || std::same_as<FpType, double>)
> > >> && std::numeric_limits<FpType>::is_iec559
> > >> int giveSign( FpType value )
> > >> {
> > >> using namespace std;
> > >> conditional_t<same_as<FpType, float>, int32_t, int64_t> iValue;
> > >> memcpy( &iValue, &value, sizeof value );
> > >> return (iValue > 0) - (iValue < 0);
> > >> }
> > >>
> > >> template
> > >> int giveSign( float );
> > >>
> > >> template
> > >> int giveSign( double );
> > >> Gives:
> > >>
> > >> "??$giveSign@M@@YAHM@Z":
> > >> movd eax, xmm0
> > >> xor ecx, ecx
> > >> test eax, eax
> > >> setg cl
> > >> sar eax, 31
> > >> add eax, ecx
> > >> ret
> > >>
> > >> "??$giveSign@N@@YAHN@Z":
> > >> movq rax, xmm0
> > >> xor ecx, ecx
> > >> test rax, rax
> > >> setg cl
> > >> sar rax, 63
> > >> add eax, ecx
> > >>
> > >> Compiler: clang-cl 13.
> > >
> > > only this assembly is interesting for me ..still for a such thing as sign it seem a
> > > long assembly
> > Show me the according C-functions with equal performance
> > and their clang-assembly.
> why you think i need to show that - its ypour imagination you need to fight a war
> proving c++ is better than c...for me its psychiatric

on assembly level ( x86 ) there is sign flag that is set by some operation
so in fact to know sing one need like a zero instructions (and thats a good design imo)

though i dont know x86 assembly to much (even though i wrote x86 assembler)
and dont exactly remember which assembly obcode allows some to use this flag
to do the counting

like:
x = sign(d)*d*d

as i said ehen i last measured it conditional jumps are costly in code (even to 30 cycles which
is a lot, but maybe on newer cpu its less) and it would be better to have conditional instructions
not doing conditional jumps, something like

movd xmm0 (d)
mulss xmm0 xmm0
mullss_bysignflag xmm0
movd (x) xmm0

but im not sure as there is adequate instruction (and above the flag probably woudl better
be converted to register value as mulss xmm0 xmm0 probably changes/overwrites flag)

Re: eficient float sign routine

<ef0ef6fe-7ee5-4023-81a4-c505f76f1d39n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21779&group=comp.lang.c#21779

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:6206:b0:2f1:d7bc:7522 with SMTP id hj6-20020a05622a620600b002f1d7bc7522mr40317148qtb.556.1653819375815;
Sun, 29 May 2022 03:16:15 -0700 (PDT)
X-Received: by 2002:a05:620a:13cc:b0:6a3:ae84:470 with SMTP id
g12-20020a05620a13cc00b006a3ae840470mr20881905qkl.655.1653819375628; Sun, 29
May 2022 03:16:15 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 29 May 2022 03:16:15 -0700 (PDT)
In-Reply-To: <c88b592d-012c-4c6c-81cc-6f0633b01a57n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.215; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.215
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me> <558d49fa-47aa-4b13-b5c4-937ce8dd8c6bn@googlegroups.com>
<t6vfv8$dc$2@dont-email.me> <5921d9d0-166a-4b4a-ba01-ef19995511f5n@googlegroups.com>
<c88b592d-012c-4c6c-81cc-6f0633b01a57n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ef0ef6fe-7ee5-4023-81a4-c505f76f1d39n@googlegroups.com>
Subject: Re: eficient float sign routine
From: profesor...@gmail.com (fir)
Injection-Date: Sun, 29 May 2022 10:16:15 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Sun, 29 May 2022 10:16 UTC

niedziela, 29 maja 2022 o 12:08:21 UTC+2 fir napisał(a):
> niedziela, 29 maja 2022 o 11:58:55 UTC+2 fir napisał(a):
> > niedziela, 29 maja 2022 o 11:56:05 UTC+2 Bonita Montero napisał(a):
> > > Am 29.05.2022 um 11:40 schrieb fir:
> > > > sobota, 28 maja 2022 o 19:49:38 UTC+2 Bonita Montero napisał(a):
> > > >> Sorry, litle mistake:
> > > >> #include <cstdint>
> > > >> #include <cstring>
> > > >> #include <limits>
> > > >> #include <concepts>
> > > >> #include <type_traits>
> > > >>
> > > >> template<typename FpType>
> > > >> requires (std::same_as<FpType, float> || std::same_as<FpType, double>)
> > > >> && std::numeric_limits<FpType>::is_iec559
> > > >> int giveSign( FpType value )
> > > >> {
> > > >> using namespace std;
> > > >> conditional_t<same_as<FpType, float>, int32_t, int64_t> iValue;
> > > >> memcpy( &iValue, &value, sizeof value );
> > > >> return (iValue > 0) - (iValue < 0);
> > > >> }
> > > >>
> > > >> template
> > > >> int giveSign( float );
> > > >>
> > > >> template
> > > >> int giveSign( double );
> > > >> Gives:
> > > >>
> > > >> "??$giveSign@M@@YAHM@Z":
> > > >> movd eax, xmm0
> > > >> xor ecx, ecx
> > > >> test eax, eax
> > > >> setg cl
> > > >> sar eax, 31
> > > >> add eax, ecx
> > > >> ret
> > > >>
> > > >> "??$giveSign@N@@YAHN@Z":
> > > >> movq rax, xmm0
> > > >> xor ecx, ecx
> > > >> test rax, rax
> > > >> setg cl
> > > >> sar rax, 63
> > > >> add eax, ecx
> > > >>
> > > >> Compiler: clang-cl 13.
> > > >
> > > > only this assembly is interesting for me ..still for a such thing as sign it seem a
> > > > long assembly
> > > Show me the according C-functions with equal performance
> > > and their clang-assembly.
> > why you think i need to show that - its ypour imagination you need to fight a war
> > proving c++ is better than c...for me its psychiatric
> on assembly level ( x86 ) there is sign flag that is set by some operation
> so in fact to know sing one need like a zero instructions (and thats a good design imo)
>
> though i dont know x86 assembly to much (even though i wrote x86 assembler)
> and dont exactly remember which assembly obcode allows some to use this flag
> to do the counting
>
> like:
> x = sign(d)*d*d
>
> as i said ehen i last measured it conditional jumps are costly in code (even to 30 cycles which
> is a lot, but maybe on newer cpu its less) and it would be better to have conditional instructions
> not doing conditional jumps, something like
>
> movd xmm0 (d)
> mulss xmm0 xmm0
> mullss_bysignflag xmm0
> movd (x) xmm0
>
> but im not sure as there is adequate instruction (and above the flag probably woudl better
> be converted to register value as mulss xmm0 xmm0 probably changes/overwrites flag)

in the assembly you got there is an instruction setg (which seem to set byte to 0 or 1 based on falgs) but i dont know what cl means

https://c9x.me/x86/html/file_module_x86_id_288.html

is there them an instruction converting byte to xmm1 as float?

Re: eficient float sign routine

<t6vj7k$mj5$5@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21780&group=comp.lang.c#21780

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: eficient float sign routine
Date: Sun, 29 May 2022 12:51:42 +0200
Organization: A noiseless patient Spider
Lines: 61
Message-ID: <t6vj7k$mj5$5@dont-email.me>
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me>
<558d49fa-47aa-4b13-b5c4-937ce8dd8c6bn@googlegroups.com>
<t6vfv8$dc$2@dont-email.me>
<5921d9d0-166a-4b4a-ba01-ef19995511f5n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 29 May 2022 10:51:32 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="617106b4ae0eb2c50f972941a2ba0003";
logging-data="23141"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/pI2D8yQ7gE2Rl8Rs6FV4KhJ+YmXA0sKY="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:eOSp7XEkTCQtXpZntlU93M9FgHo=
In-Reply-To: <5921d9d0-166a-4b4a-ba01-ef19995511f5n@googlegroups.com>
Content-Language: de-DE
 by: Bonita Montero - Sun, 29 May 2022 10:51 UTC

Am 29.05.2022 um 11:58 schrieb fir:
> niedziela, 29 maja 2022 o 11:56:05 UTC+2 Bonita Montero napisał(a):
>> Am 29.05.2022 um 11:40 schrieb fir:
>>> sobota, 28 maja 2022 o 19:49:38 UTC+2 Bonita Montero napisał(a):
>>>> Sorry, litle mistake:
>>>> #include <cstdint>
>>>> #include <cstring>
>>>> #include <limits>
>>>> #include <concepts>
>>>> #include <type_traits>
>>>>
>>>> template<typename FpType>
>>>> requires (std::same_as<FpType, float> || std::same_as<FpType, double>)
>>>> && std::numeric_limits<FpType>::is_iec559
>>>> int giveSign( FpType value )
>>>> {
>>>> using namespace std;
>>>> conditional_t<same_as<FpType, float>, int32_t, int64_t> iValue;
>>>> memcpy( &iValue, &value, sizeof value );
>>>> return (iValue > 0) - (iValue < 0);
>>>> }
>>>>
>>>> template
>>>> int giveSign( float );
>>>>
>>>> template
>>>> int giveSign( double );
>>>> Gives:
>>>>
>>>> "??$giveSign@M@@YAHM@Z":
>>>> movd eax, xmm0
>>>> xor ecx, ecx
>>>> test eax, eax
>>>> setg cl
>>>> sar eax, 31
>>>> add eax, ecx
>>>> ret
>>>>
>>>> "??$giveSign@N@@YAHN@Z":
>>>> movq rax, xmm0
>>>> xor ecx, ecx
>>>> test rax, rax
>>>> setg cl
>>>> sar rax, 63
>>>> add eax, ecx
>>>>
>>>> Compiler: clang-cl 13.
>>>
>>> only this assembly is interesting for me ..still for a such thing as sign it seem a
>>> long assembly
>> Show me the according C-functions with equal performance
>> and their clang-assembly.
>
> why you think i need to show that - its ypour imagination you need to fight a war
> proving c++ is better than c...for me its psychiatric

It's not a war C++ against C. C++ has obivously advantages over
C, but not here. It's just to say that with C you don't have any
less work.

Re: eficient float sign routine

<t6vj9i$mj5$6@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21781&group=comp.lang.c#21781

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: eficient float sign routine
Date: Sun, 29 May 2022 12:52:44 +0200
Organization: A noiseless patient Spider
Lines: 5
Message-ID: <t6vj9i$mj5$6@dont-email.me>
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me>
<558d49fa-47aa-4b13-b5c4-937ce8dd8c6bn@googlegroups.com>
<t6vfv8$dc$2@dont-email.me>
<5921d9d0-166a-4b4a-ba01-ef19995511f5n@googlegroups.com>
<c88b592d-012c-4c6c-81cc-6f0633b01a57n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 29 May 2022 10:52:34 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="617106b4ae0eb2c50f972941a2ba0003";
logging-data="23141"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/s0qC22rcYA29tXaSKvFRJ2S8l6dkb1oA="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:NAB1w4YLyvWZF0HqDkPPuDueag0=
In-Reply-To: <c88b592d-012c-4c6c-81cc-6f0633b01a57n@googlegroups.com>
Content-Language: de-DE
 by: Bonita Montero - Sun, 29 May 2022 10:52 UTC

> as i said ehen i last measured it conditional jumps are costly in code (even to 30 cycles which
> is a lot, but maybe on newer cpu its less) and it would be better to have conditional instructions
> not doing conditional jumps, something like

Where were the jumps in the clang 13 output I've shown ?

Re: eficient float sign routine

<t6vjbc$mj5$7@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21782&group=comp.lang.c#21782

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: eficient float sign routine
Date: Sun, 29 May 2022 12:53:42 +0200
Organization: A noiseless patient Spider
Lines: 5
Message-ID: <t6vjbc$mj5$7@dont-email.me>
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me>
<558d49fa-47aa-4b13-b5c4-937ce8dd8c6bn@googlegroups.com>
<t6vfv8$dc$2@dont-email.me>
<5921d9d0-166a-4b4a-ba01-ef19995511f5n@googlegroups.com>
<c88b592d-012c-4c6c-81cc-6f0633b01a57n@googlegroups.com>
<ef0ef6fe-7ee5-4023-81a4-c505f76f1d39n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 29 May 2022 10:53:32 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="617106b4ae0eb2c50f972941a2ba0003";
logging-data="23141"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ogMv5irMZOdpZdaq3TMVlagh5hf9dFnQ="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:r2Xvzf8B4f1+aeDheNHvC65fw8k=
In-Reply-To: <ef0ef6fe-7ee5-4023-81a4-c505f76f1d39n@googlegroups.com>
Content-Language: de-DE
 by: Bonita Montero - Sun, 29 May 2022 10:53 UTC

> in the assembly you got there is an instruction setg (which seem to set byte to 0 or 1 based on falgs) but i dont know what cl means

Sorry, if you don't understand the compiler output
please say nothing.

Re: eficient float sign routine

<69019d10-4416-4e42-80ca-69b58c74af3bn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21783&group=comp.lang.c#21783

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:5c96:0:b0:2f9:3077:5cda with SMTP id r22-20020ac85c96000000b002f930775cdamr30579963qta.625.1653821861096;
Sun, 29 May 2022 03:57:41 -0700 (PDT)
X-Received: by 2002:a05:6214:2523:b0:464:3296:4819 with SMTP id
gg3-20020a056214252300b0046432964819mr7852405qvb.85.1653821860903; Sun, 29
May 2022 03:57:40 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 29 May 2022 03:57:40 -0700 (PDT)
In-Reply-To: <c88b592d-012c-4c6c-81cc-6f0633b01a57n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.70; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.70
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me> <558d49fa-47aa-4b13-b5c4-937ce8dd8c6bn@googlegroups.com>
<t6vfv8$dc$2@dont-email.me> <5921d9d0-166a-4b4a-ba01-ef19995511f5n@googlegroups.com>
<c88b592d-012c-4c6c-81cc-6f0633b01a57n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <69019d10-4416-4e42-80ca-69b58c74af3bn@googlegroups.com>
Subject: Re: eficient float sign routine
From: profesor...@gmail.com (fir)
Injection-Date: Sun, 29 May 2022 10:57:41 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Sun, 29 May 2022 10:57 UTC

niedziela, 29 maja 2022 o 12:08:21 UTC+2 fir napisał(a):
>
> like:
> x = sign(d)*d*d
>

in fact fabs could go here and i do some tests

void RunFrame(int advance)
{ ClearFrameData(0x505077);
sum = 0;
for(float f= -333333.33; f< 333333.3; f+=0.111)
// sum = -copysignf(1,f)*f*f; //26 ms //29 ms
sum = -fabs(f)*f; //26 ms //34 ms

DrawSomeText2(0xff0000, 10 , 30, "aaaa %f", sum);
}

i test it pitting some dosed in frame ofthe game as my little library has a built in plot
showing frame times so i may see olways live what my game changes effect on frame times

i tested it on gcc 5 and gcc 10 - i more use gcc5 for some reason i dont remember which one
maybe it compiles faster or maybe becouse another reasons (various version of compilers sometimes
compiel some things better and some other worse so its the best to have couple and test them all
from time to time)

some may also test it of have windows, only need to have mingw/tdm installed and put path to in tn compile.vat first line

http://filesharing24.com/d/Ofo

Re: eficient float sign routine

<3f31a9f0-5ccc-4a53-a970-2e8c3222fd2an@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21784&group=comp.lang.c#21784

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:4542:b0:6a0:651b:be0b with SMTP id u2-20020a05620a454200b006a0651bbe0bmr33833939qkp.633.1653821968242;
Sun, 29 May 2022 03:59:28 -0700 (PDT)
X-Received: by 2002:a05:6214:f22:b0:464:4f86:c0ef with SMTP id
iw2-20020a0562140f2200b004644f86c0efmr271497qvb.13.1653821968123; Sun, 29 May
2022 03:59:28 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 29 May 2022 03:59:27 -0700 (PDT)
In-Reply-To: <t6vj9i$mj5$6@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.70; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.70
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me> <558d49fa-47aa-4b13-b5c4-937ce8dd8c6bn@googlegroups.com>
<t6vfv8$dc$2@dont-email.me> <5921d9d0-166a-4b4a-ba01-ef19995511f5n@googlegroups.com>
<c88b592d-012c-4c6c-81cc-6f0633b01a57n@googlegroups.com> <t6vj9i$mj5$6@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3f31a9f0-5ccc-4a53-a970-2e8c3222fd2an@googlegroups.com>
Subject: Re: eficient float sign routine
From: profesor...@gmail.com (fir)
Injection-Date: Sun, 29 May 2022 10:59:28 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2014
 by: fir - Sun, 29 May 2022 10:59 UTC

niedziela, 29 maja 2022 o 12:52:46 UTC+2 Bonita Montero napisał(a):
> > as i said ehen i last measured it conditional jumps are costly in code (even to 30 cycles which
> > is a lot, but maybe on newer cpu its less) and it would be better to have conditional instructions
> > not doing conditional jumps, something like
> Where were the jumps in the clang 13 output I've shown ?

youre crazy so you give extreme failure questions i for example did not said nothing about that and it was simply general note - but your state of mind disalows you to read it

Re: eficient float sign routine

<5f7e2898-0e68-43be-8db4-cc27deb53965n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21785&group=comp.lang.c#21785

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:205:b0:2fc:45f8:9714 with SMTP id b5-20020a05622a020500b002fc45f89714mr13664422qtx.257.1653821984166;
Sun, 29 May 2022 03:59:44 -0700 (PDT)
X-Received: by 2002:a05:620a:2544:b0:680:a53b:ec1a with SMTP id
s4-20020a05620a254400b00680a53bec1amr34935229qko.544.1653821984044; Sun, 29
May 2022 03:59:44 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!pasdenom.info!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 29 May 2022 03:59:43 -0700 (PDT)
In-Reply-To: <t6vjbc$mj5$7@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.70; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.70
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me> <558d49fa-47aa-4b13-b5c4-937ce8dd8c6bn@googlegroups.com>
<t6vfv8$dc$2@dont-email.me> <5921d9d0-166a-4b4a-ba01-ef19995511f5n@googlegroups.com>
<c88b592d-012c-4c6c-81cc-6f0633b01a57n@googlegroups.com> <ef0ef6fe-7ee5-4023-81a4-c505f76f1d39n@googlegroups.com>
<t6vjbc$mj5$7@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5f7e2898-0e68-43be-8db4-cc27deb53965n@googlegroups.com>
Subject: Re: eficient float sign routine
From: profesor...@gmail.com (fir)
Injection-Date: Sun, 29 May 2022 10:59:44 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Sun, 29 May 2022 10:59 UTC

niedziela, 29 maja 2022 o 12:53:44 UTC+2 Bonita Montero napisał(a):
> > in the assembly you got there is an instruction setg (which seem to set byte to 0 or 1 based on falgs) but i dont know what cl means
> Sorry, if you don't understand the compiler output
> please say nothing.

i must reject, i say what i want

Re: eficient float sign routine

<a2f139d3-0b5b-45ef-b656-349a093daeben@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21786&group=comp.lang.c#21786

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:2a14:b0:6a3:8820:283e with SMTP id o20-20020a05620a2a1400b006a38820283emr23614296qkp.53.1653822060477;
Sun, 29 May 2022 04:01:00 -0700 (PDT)
X-Received: by 2002:a05:620a:29c2:b0:6a0:5fac:2f45 with SMTP id
s2-20020a05620a29c200b006a05fac2f45mr32193669qkp.529.1653822060188; Sun, 29
May 2022 04:01:00 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 29 May 2022 04:00:59 -0700 (PDT)
In-Reply-To: <69019d10-4416-4e42-80ca-69b58c74af3bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.70; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.70
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me> <558d49fa-47aa-4b13-b5c4-937ce8dd8c6bn@googlegroups.com>
<t6vfv8$dc$2@dont-email.me> <5921d9d0-166a-4b4a-ba01-ef19995511f5n@googlegroups.com>
<c88b592d-012c-4c6c-81cc-6f0633b01a57n@googlegroups.com> <69019d10-4416-4e42-80ca-69b58c74af3bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a2f139d3-0b5b-45ef-b656-349a093daeben@googlegroups.com>
Subject: Re: eficient float sign routine
From: profesor...@gmail.com (fir)
Injection-Date: Sun, 29 May 2022 11:01:00 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2928
 by: fir - Sun, 29 May 2022 11:00 UTC

niedziela, 29 maja 2022 o 12:57:48 UTC+2 fir napisał(a):
> niedziela, 29 maja 2022 o 12:08:21 UTC+2 fir napisał(a):
> >
> > like:
> > x = sign(d)*d*d
> >
>
> in fact fabs could go here and i do some tests
>
> void RunFrame(int advance)
> {
> ClearFrameData(0x505077);
> sum = 0;
> for(float f= -333333.33; f< 333333.3; f+=0.111)
> // sum = -copysignf(1,f)*f*f; //26 ms //29 ms
> sum = -fabs(f)*f; //26 ms //34 ms
>
> DrawSomeText2(0xff0000, 10 , 30, "aaaa %f", sum);
> }
>
> i test it pitting some dosed in frame ofthe game as my little library has a built in plot
> showing frame times so i may see olways live what my game changes effect on frame times
>
> i tested it on gcc 5 and gcc 10 - i more use gcc5 for some reason i dont remember which one
> maybe it compiles faster or maybe becouse another reasons (various version of compilers sometimes
> compiel some things better and some other worse so its the best to have couple and test them all
> from time to time)
>

i mean those two numbers 29 ms and 34 ms are on gcc5 and 26 26 are on gcc10
(it showed gcc10 is faster here but i wouldnt say its generel rule)

> some may also test it of have windows, only need to have mingw/tdm installed and put path to in tn compile.vat first line
>
> http://filesharing24.com/d/Ofo

Re: eficient float sign routine

<7fbe61f5-d94e-41b6-86c3-d9f4d48fc9b6n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21787&group=comp.lang.c#21787

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:7d8e:0:b0:2f9:3bd1:9d6c with SMTP id c14-20020ac87d8e000000b002f93bd19d6cmr25622209qtd.186.1653822324149;
Sun, 29 May 2022 04:05:24 -0700 (PDT)
X-Received: by 2002:ad4:5948:0:b0:461:fc7d:a48d with SMTP id
eo8-20020ad45948000000b00461fc7da48dmr40003548qvb.96.1653822323950; Sun, 29
May 2022 04:05:23 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 29 May 2022 04:05:23 -0700 (PDT)
In-Reply-To: <69019d10-4416-4e42-80ca-69b58c74af3bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.70; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.70
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me> <558d49fa-47aa-4b13-b5c4-937ce8dd8c6bn@googlegroups.com>
<t6vfv8$dc$2@dont-email.me> <5921d9d0-166a-4b4a-ba01-ef19995511f5n@googlegroups.com>
<c88b592d-012c-4c6c-81cc-6f0633b01a57n@googlegroups.com> <69019d10-4416-4e42-80ca-69b58c74af3bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7fbe61f5-d94e-41b6-86c3-d9f4d48fc9b6n@googlegroups.com>
Subject: Re: eficient float sign routine
From: profesor...@gmail.com (fir)
Injection-Date: Sun, 29 May 2022 11:05:24 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3118
 by: fir - Sun, 29 May 2022 11:05 UTC

niedziela, 29 maja 2022 o 12:57:48 UTC+2 fir napisał(a):
> niedziela, 29 maja 2022 o 12:08:21 UTC+2 fir napisał(a):
> >
> > like:
> > x = sign(d)*d*d
> >
>
> in fact fabs could go here and i do some tests
>
> void RunFrame(int advance)
> {
> ClearFrameData(0x505077);
> sum = 0;
> for(float f= -333333.33; f< 333333.3; f+=0.111)
> // sum = -copysignf(1,f)*f*f; //26 ms //29 ms
> sum = -fabs(f)*f; //26 ms //34 ms
>
> DrawSomeText2(0xff0000, 10 , 30, "aaaa %f", sum);
> }
>
> i test it pitting some dosed in frame ofthe game as my little library has a built in plot
> showing frame times so i may see olways live what my game changes effect on frame times
>
> i tested it on gcc 5 and gcc 10 - i more use gcc5 for some reason i dont remember which one
> maybe it compiles faster or maybe becouse another reasons (various version of compilers sometimes
> compiel some things better and some other worse so its the best to have couple and test them all
> from time to time)
>
> some may also test it of have windows, only need to have mingw/tdm installed and put path to in tn compile.vat first line
>
> http://filesharing24.com/d/Ofo

btw if some would like test it when runing it press f4 and hold, it sets sleep in the loop to zero so only there the value is real (sleep is added to not make cpu work on full load, and teh counter counts difference in time including all round (including sleep) but in case of testing one want to sleep zero to see minimal frame time)

Re: eficient float sign routine

<t6vkg2$oks$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21788&group=comp.lang.c#21788

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: eficient float sign routine
Date: Sun, 29 May 2022 13:13:15 +0200
Organization: A noiseless patient Spider
Lines: 2
Message-ID: <t6vkg2$oks$1@dont-email.me>
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me>
<558d49fa-47aa-4b13-b5c4-937ce8dd8c6bn@googlegroups.com>
<t6vfv8$dc$2@dont-email.me>
<5921d9d0-166a-4b4a-ba01-ef19995511f5n@googlegroups.com>
<c88b592d-012c-4c6c-81cc-6f0633b01a57n@googlegroups.com>
<69019d10-4416-4e42-80ca-69b58c74af3bn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 29 May 2022 11:13:06 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="617106b4ae0eb2c50f972941a2ba0003";
logging-data="25244"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18+ClmVvbSDuKLNznDKzzmPuzpwbn2nBy8="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:J9jN39Jzog+d0ZWEKbGizkKQ1+k=
In-Reply-To: <69019d10-4416-4e42-80ca-69b58c74af3bn@googlegroups.com>
Content-Language: de-DE
 by: Bonita Montero - Sun, 29 May 2022 11:13 UTC

You seem to be manic.
No need to talk to you.

Re: eficient float sign routine

<295d93a5-e9d7-4681-85ba-f1368b46408fn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21789&group=comp.lang.c#21789

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:c99:b0:6a3:3c41:2d6 with SMTP id q25-20020a05620a0c9900b006a33c4102d6mr32268379qki.744.1653823204362;
Sun, 29 May 2022 04:20:04 -0700 (PDT)
X-Received: by 2002:ac8:7d13:0:b0:2f3:b53c:a691 with SMTP id
g19-20020ac87d13000000b002f3b53ca691mr40589869qtb.525.1653823204199; Sun, 29
May 2022 04:20:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 29 May 2022 04:20:03 -0700 (PDT)
In-Reply-To: <t6vkg2$oks$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.70; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.70
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me> <558d49fa-47aa-4b13-b5c4-937ce8dd8c6bn@googlegroups.com>
<t6vfv8$dc$2@dont-email.me> <5921d9d0-166a-4b4a-ba01-ef19995511f5n@googlegroups.com>
<c88b592d-012c-4c6c-81cc-6f0633b01a57n@googlegroups.com> <69019d10-4416-4e42-80ca-69b58c74af3bn@googlegroups.com>
<t6vkg2$oks$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <295d93a5-e9d7-4681-85ba-f1368b46408fn@googlegroups.com>
Subject: Re: eficient float sign routine
From: profesor...@gmail.com (fir)
Injection-Date: Sun, 29 May 2022 11:20:04 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1624
 by: fir - Sun, 29 May 2022 11:20 UTC

niedziela, 29 maja 2022 o 13:13:19 UTC+2 Bonita Montero napisał(a):
> You seem to be manic.
> No need to talk to you.

lol

Re: eficient float sign routine

<3671a74a-c5e5-4fc3-966f-c0913e6d1ab6n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21790&group=comp.lang.c#21790

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:59d3:0:b0:2f3:d7ee:2b54 with SMTP id f19-20020ac859d3000000b002f3d7ee2b54mr40852561qtf.290.1653823500014;
Sun, 29 May 2022 04:25:00 -0700 (PDT)
X-Received: by 2002:a05:6214:2a88:b0:464:463a:7a7c with SMTP id
jr8-20020a0562142a8800b00464463a7a7cmr3198029qvb.127.1653823499898; Sun, 29
May 2022 04:24:59 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 29 May 2022 04:24:59 -0700 (PDT)
In-Reply-To: <295d93a5-e9d7-4681-85ba-f1368b46408fn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.70; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.70
References: <a2c40762-4e51-41e0-9f31-0a780e5370bcn@googlegroups.com>
<t6tmt6$d76$1@dont-email.me> <t6tnb4$fe1$1@dont-email.me> <558d49fa-47aa-4b13-b5c4-937ce8dd8c6bn@googlegroups.com>
<t6vfv8$dc$2@dont-email.me> <5921d9d0-166a-4b4a-ba01-ef19995511f5n@googlegroups.com>
<c88b592d-012c-4c6c-81cc-6f0633b01a57n@googlegroups.com> <69019d10-4416-4e42-80ca-69b58c74af3bn@googlegroups.com>
<t6vkg2$oks$1@dont-email.me> <295d93a5-e9d7-4681-85ba-f1368b46408fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3671a74a-c5e5-4fc3-966f-c0913e6d1ab6n@googlegroups.com>
Subject: Re: eficient float sign routine
From: profesor...@gmail.com (fir)
Injection-Date: Sun, 29 May 2022 11:25:00 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Sun, 29 May 2022 11:24 UTC

niedziela, 29 maja 2022 o 13:20:11 UTC+2 fir napisał(a):
> niedziela, 29 maja 2022 o 13:13:19 UTC+2 Bonita Montero napisał(a):
> > You seem to be manic.
> > No need to talk to you.
> lol

honestly i dont feel manic but im feeling old thats why i got problems with concentration and finding info often recent times... used to be better back then

Pages:123
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor