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


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

How to create a 128 bit type in C

Started byacidlategamer@gmail.com
First post2017-03-28 08:26 -0700
Last post2017-03-30 05:40 -0700
Articles 2 on this page of 62 — 18 participants

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


Contents

  How to create a 128 bit type in C acidlategamer@gmail.com - 2017-03-28 08:26 -0700
    Re: How to create a 128 bit type in C BartC <bc@freeuk.com> - 2017-03-28 16:42 +0100
      Re: How to create a 128 bit type in C acidlategamer@gmail.com - 2017-03-28 09:15 -0700
        Re: How to create a 128 bit type in C BartC <bc@freeuk.com> - 2017-03-28 19:15 +0100
    Re: How to create a 128 bit type in C Norbert_Paul <norbertpauls_spambin@yahoo.com> - 2017-03-28 17:44 +0200
    Re: How to create a 128 bit type in C scott@slp53.sl.home (Scott Lurndal) - 2017-03-28 16:29 +0000
      Re: How to create a 128 bit type in C Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-03-28 10:52 -0700
        Re: How to create a 128 bit type in C Ike Naar <ike@iceland.freeshell.org> - 2017-03-28 17:55 +0000
          Re: How to create a 128 bit type in C jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-28 20:17 +0200
            Re: How to create a 128 bit type in C David Brown <david.brown@hesbynett.no> - 2017-03-28 21:17 +0200
        Re: How to create a 128 bit type in C scott@slp53.sl.home (Scott Lurndal) - 2017-03-28 18:09 +0000
      Re: How to create a 128 bit type in C jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-28 19:52 +0200
        Re: How to create a 128 bit type in C scott@slp53.sl.home (Scott Lurndal) - 2017-03-28 18:11 +0000
          Re: How to create a 128 bit type in C BartC <bc@freeuk.com> - 2017-03-28 19:21 +0100
            Re: How to create a 128 bit type in C jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-28 20:29 +0200
              Re: How to create a 128 bit type in C scott@slp53.sl.home (Scott Lurndal) - 2017-03-28 18:55 +0000
                Re: How to create a 128 bit type in C jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-28 21:04 +0200
            Re: How to create a 128 bit type in C Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-03-28 12:13 -0700
              Re: How to create a 128 bit type in C Robert Wessel <robertwessel2@yahoo.com> - 2017-03-28 16:14 -0500
                Re: How to create a 128 bit type in C scott@slp53.sl.home (Scott Lurndal) - 2017-03-29 13:13 +0000
                  Re: How to create a 128 bit type in C Robert Wessel <robertwessel2@yahoo.com> - 2017-03-30 00:12 -0500
                    Re: How to create a 128 bit type in C scott@slp53.sl.home (Scott Lurndal) - 2017-03-30 13:36 +0000
                      Re: How to create a 128 bit type in C Robert Wessel <robertwessel2@yahoo.com> - 2017-03-30 12:41 -0500
                        Re: How to create a 128 bit type in C scott@slp53.sl.home (Scott Lurndal) - 2017-03-30 17:55 +0000
                        Re: How to create a 128 bit type in C scott@slp53.sl.home (Scott Lurndal) - 2017-03-30 17:59 +0000
                          Re: How to create a 128 bit type in C Robert Wessel <robertwessel2@yahoo.com> - 2017-04-01 00:42 -0500
                            Re: How to create a 128 bit type in C scott@slp53.sl.home (Scott Lurndal) - 2017-04-03 13:37 +0000
                              Re: How to create a 128 bit type in C Robert Wessel <robertwessel2@yahoo.com> - 2017-04-03 17:38 -0500
                                Re: How to create a 128 bit type in C Robert Wessel <robertwessel2@yahoo.com> - 2017-04-03 17:49 -0500
                                  Re: How to create a 128 bit type in C Keith Thompson <kst-u@mib.org> - 2017-04-03 17:43 -0700
                                    Re: How to create a 128 bit type in C Robert Wessel <robertwessel2@yahoo.com> - 2017-04-03 20:39 -0500
                                Re: How to create a 128 bit type in C Richard Heathfield <rjh@cpax.org.uk> - 2017-04-04 07:00 +0100
          Re: How to create a 128 bit type in C jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-28 20:28 +0200
            Re: How to create a 128 bit type in C Robert Wessel <robertwessel2@yahoo.com> - 2017-03-28 16:37 -0500
              Re: How to create a 128 bit type in C jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-28 23:56 +0200
                Re: How to create a 128 bit type in C Robert Wessel <robertwessel2@yahoo.com> - 2017-03-28 18:36 -0500
                  Re: How to create a 128 bit type in C jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-29 01:43 +0200
                    Re: English grammar, nonrestrictive clause Noob <root@127.0.0.1> - 2017-03-31 21:24 +0200
                      Re: English grammar, nonrestrictive clause jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-31 21:51 +0200
                        Re: English grammar, nonrestrictive clause Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-04-01 12:34 +0100
              Re: How to create a 128 bit type in C supercat@casperkitty.com - 2017-03-28 15:11 -0700
                Re: How to create a 128 bit type in C Robert Wessel <robertwessel2@yahoo.com> - 2017-03-28 19:30 -0500
              Re: How to create a 128 bit type in C scott@slp53.sl.home (Scott Lurndal) - 2017-03-29 13:19 +0000
                Re: How to create a 128 bit type in C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-03-29 14:42 +0100
                  Re: How to create a 128 bit type in C scott@slp53.sl.home (Scott Lurndal) - 2017-03-29 15:12 +0000
                  Re: How to create a 128 bit type in C Robert Wessel <robertwessel2@yahoo.com> - 2017-03-30 00:26 -0500
                Re: How to create a 128 bit type in C Robert Wessel <robertwessel2@yahoo.com> - 2017-03-30 00:42 -0500
        Re: How to create a 128 bit type in C Keith Thompson <kst-u@mib.org> - 2017-03-28 11:40 -0700
        Re: How to create a 128 bit type in C Keith Thompson <kst-u@mib.org> - 2017-03-28 11:40 -0700
          Re: How to create a 128 bit type in C jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-28 20:48 +0200
            Re: How to create a 128 bit type in C Keith Thompson <kst-u@mib.org> - 2017-03-28 12:05 -0700
              Re: How to create a 128 bit type in C Richard Heathfield <rjh@cpax.org.uk> - 2017-03-28 20:13 +0100
                Re: How to create a 128 bit type in C jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-28 21:43 +0200
                  Re: Thunderbird charset Noob <root@127.0.0.1> - 2017-03-31 21:38 +0200
      Re: How to create a 128 bit type in C David Brown <david.brown@hesbynett.no> - 2017-03-28 21:19 +0200
    Re: How to create a 128 bit type in C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-03-28 18:15 +0100
    Re: How to create a 128 bit type in C Barry Schwarz <schwarzb@dqel.com> - 2017-03-28 10:27 -0700
    Re: How to create a 128 bit type in C "Chris M. Thomasson" <invalid@invalid.invalid> - 2017-03-28 14:16 -0700
    Re: How to create a 128 bit type in C "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-03-28 17:38 -0700
    Re: How to create a 128 bit type in C Thiago Adams <thiago.adams@gmail.com> - 2017-03-30 05:19 -0700
      Re: How to create a 128 bit type in C Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-03-30 05:32 -0700
        Re: How to create a 128 bit type in C Thiago Adams <thiago.adams@gmail.com> - 2017-03-30 05:40 -0700

Page 4 of 4 — ← Prev page 1 2 3 [4]


#107476

FromMalcolm McLean <malcolm.mclean5@btinternet.com>
Date2017-03-30 05:32 -0700
Message-ID<f3cd72f4-c568-4ffc-a3af-473b8bba0185@googlegroups.com>
In reply to#107473
On Thursday, March 30, 2017 at 1:19:44 PM UTC+1, Thiago Adams wrote:
> On Tuesday, March 28, 2017 at 12:27:01 PM UTC-3, acidla...@gmail.com wrote:
> > Hi all,
> > 
> > Today a friend of mine asked this to me
> > create a 128 bit type and you are given two 64 bit int type. One is sint64_t and one is uint64_t
> 
> 
> Once I did some functions to work with variable number of bits.
> It's is C++ but can be easily adapted to C. 
> 
> http://thradams.com/mathlib.htm
>
Creating new numerical types is one place where C++ really makes sense.

Code is very hard to read if addition is 

   s128_add(&result, a b);

and the same is true for the other four arithmetical operation.
 

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


#107480

FromThiago Adams <thiago.adams@gmail.com>
Date2017-03-30 05:40 -0700
Message-ID<9750807d-1649-4c3a-9ed9-f4c444a013f4@googlegroups.com>
In reply to#107476
On Thursday, March 30, 2017 at 9:33:17 AM UTC-3, Malcolm McLean wrote:
> On Thursday, March 30, 2017 at 1:19:44 PM UTC+1, Thiago Adams wrote:
> > On Tuesday, March 28, 2017 at 12:27:01 PM UTC-3, acidla...@gmail.com wrote:
> > > Hi all,
> > > 
> > > Today a friend of mine asked this to me
> > > create a 128 bit type and you are given two 64 bit int type. One is sint64_t and one is uint64_t
> > 
> > 
> > Once I did some functions to work with variable number of bits.
> > It's is C++ but can be easily adapted to C. 
> > 
> > http://thradams.com/mathlib.htm
> >
> Creating new numerical types is one place where C++ really makes sense.
> 
> Code is very hard to read if addition is 
> 
>    s128_add(&result, a b);
> 
> and the same is true for the other four arithmetical operation.

C++ help me to test using the same template code using different types and bases.

To convert to C, it's necessary to create "instances" with names add_base10_int something like that.
Maybe the selection also could be done using _Generic.

I would not use C++ to override operators +, - etc..
Because this could be added latter (in other code) if someone need.

[toc] | [prev] | [standalone]


Page 4 of 4 — ← Prev page 1 2 3 [4]

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


csiph-web