473,472 Members | 2,181 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

128 bit integer code needed

Hi

I am incorporating 128 Bit integer code into lcc-win and it would be
nice to have some code to test this feature.

Has anyone here code that uses 128 bit integers?

Thanks in advance

P.S. This feature is now native in the 64 bit version, i.e.
not using operator overloading as in the 32 bit version.

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Jun 27 '08 #1
9 12577
jacob navia <ja***@nospam.comwrites:
I am incorporating 128 Bit integer code into lcc-win and it would be
nice to have some code to test this feature.
Sounds interesting. Out of curiosity, just how are you defining your
128-bit integer types? C99 introduced the concept of "extended
integer types" (C99 6.2.5); are you using that? If not, I encourage
you to do so. And are you making intmax_t and uintmax_t 128 bits?
Has anyone here code that uses 128 bit integers?
Sorry, I don't, but you might look for code that manipulates IPv6
addresses. (Then again, since few implementations provide 128-bit
integers, I'm sure most IPv6 code doesn't try to use them.)

--
Keith Thompson (The_Other_Keith) <ks***@mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 27 '08 #2
On Apr 29, 5:13*am, jacob navia <ja...@nospam.comwrote:
Hi

I am incorporating 128 Bit integer code into lcc-win and it would be
nice to have some code to test this feature.

Has anyone here code that uses 128 bit integers?

Thanks in advance

P.S. This feature is now native in the 64 bit version, i.e.
not using operator overloading as in the 32 bit version.
http://svn.gnucash.org/docs/HEAD/group__Math128.html
http://developer.apple.com/hardwared...ds/vBigNum.tgz

If you check out news:sci.crypt, you will find a boatload of this
stuff.
Jun 27 '08 #3
jacob navia <ja***@nospam.comwrites:
I am incorporating 128 Bit integer code into lcc-win and it would be
nice to have some code to test this feature.

Has anyone here code that uses 128 bit integers?
[...]

You might look for code that uses some extended-width integer library
such as GMP, but that doesn't need values beyond what can be
represented in 128 bits. As I wrote before, the fact that most
implementations don't provide 128-bit integers is likely to make it
hard to find code that depends on them, but the above may be a good
way to find code that *would* use 128-bit integers if they were
available.

That's admittedly vague. I'd provide more specific references if I
had any.

--
Keith Thompson (The_Other_Keith) <ks***@mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 27 '08 #4
user923005 wrote:
On Apr 29, 5:13 am, jacob navia <ja...@nospam.comwrote:
>Hi

I am incorporating 128 Bit integer code into lcc-win and it would be
nice to have some code to test this feature.

Has anyone here code that uses 128 bit integers?

Thanks in advance

P.S. This feature is now native in the 64 bit version, i.e.
not using operator overloading as in the 32 bit version.

http://svn.gnucash.org/docs/HEAD/group__Math128.html
http://developer.apple.com/hardwared...ds/vBigNum.tgz

If you check out news:sci.crypt, you will find a boatload of this
stuff.
Thanks for the tips
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Jun 27 '08 #5
Keith Thompson wrote:
jacob navia <ja***@nospam.comwrites:
>I am incorporating 128 Bit integer code into lcc-win and it would be
nice to have some code to test this feature.

Sounds interesting. Out of curiosity, just how are you defining your
128-bit integer types?
__int128

There is no unsigned as yet. Many other things must be done first:
o printing them with printf. Format "%I128d"
o scanning them with scanf. Same format
o Algebraic simplifications in the compiler
C99 introduced the concept of "extended
integer types" (C99 6.2.5); are you using that? If not, I encourage
you to do so. And are you making intmax_t and uintmax_t 128 bits?
Very probably but that is too son. I have to get the basics right first.

In 32 bits I use operator overloading and there is no printf support...
This is different.
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Jun 27 '08 #6

"jacob navia" <ja***@nospam.comwrote in message
news:fv**********@aioe.org...
Hi

I am incorporating 128 Bit integer code into lcc-win and it would be nice
to have some code to test this feature.

Has anyone here code that uses 128 bit integers?

Thanks in advance

P.S. This feature is now native in the 64 bit version, i.e.
not using operator overloading as in the 32 bit version.
my case, I just beat together more basic tests and verified output
manually...

however, in my case I also have an even more debatable feature:
128 bit pointers...

basic idea: 16 bit tag, 48 bit segment, 64 bit offset.
purpose: persistent storage, possibly DSM.
why such big segments: so they can be unique and generated with an RNG.

....
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32

Jun 27 '08 #7
jacob navia <ja***@nospam.comwrites:
Keith Thompson wrote:
>jacob navia <ja***@nospam.comwrites:
>>I am incorporating 128 Bit integer code into lcc-win and it would be
nice to have some code to test this feature.

Sounds interesting. Out of curiosity, just how are you defining your
128-bit integer types?

__int128

There is no unsigned as yet. Many other things must be done first:
o printing them with printf. Format "%I128d"
o scanning them with scanf. Same format
As long as you provide the proper macros in <inttypes.hand typedefs
in <stdint.h>, users won't have to know what format strings you use
for printf and scanf. If I can refer to int128_t (or intleast128_t or
intfast128_t), I don't have to worry about whether the underlying type
is called __int128 or __longlonglong.

(To be clear, this is not a criticism of your choice of "__int128" or
"%I128d".)

[snip]

--
Keith Thompson (The_Other_Keith) <ks***@mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 27 '08 #8
On Apr 29, 1:43*pm, jacob navia <ja...@nospam.comwrote:
user923005 wrote:
On Apr 29, 5:13 am, jacob navia <ja...@nospam.comwrote:
Hi
I am incorporating 128 Bit integer code into lcc-win and it would be
nice to have some code to test this feature.
Has anyone here code that uses 128 bit integers?
Thanks in advance
P.S. This feature is now native in the 64 bit version, i.e.
not using operator overloading as in the 32 bit version.
http://svn.gnucash.org/docs/HEAD/group__Math128.html
http://developer.apple.com/hardwared...ds/vBigNum.tgz
If you check out news:sci.crypt, you will find a boatload of this
stuff.

Thanks for the tips
Here are some integer multiplication benchmarks:
http://cr.yp.to/speed/mult.html

Here are some crypto links:
http://directory.google.com/Top/Scie...ing_Libraries/
<OT>
I don't know if you can use C++, but the Crypto++ library has an
Integer class with all the operations defined.
integer.h(217): Integer& operator=(const Integer& t);
integer.h(220): Integer& operator+=(const Integer& t);
integer.h(222): Integer& operator-=(const Integer& t);
integer.h(224): Integer& operator*=(const Integer& t) {return *this =
Times(t);}
integer.h(226): Integer& operator/=(const Integer& t) {return *this =
DividedBy(t);}
integer.h(228): Integer& operator%=(const Integer& t) {return *this =
Modulo(t);}
integer.h(230): Integer& operator/=(word t) {return *this =
DividedBy(t);}
integer.h(232): Integer& operator%=(word t) {return *this =
Integer(POSITIVE, 0, Modulo(t));}
integer.h(235): Integer& operator<<=(size_t);
integer.h(237): Integer& operator>>=(size_t);
integer.h(273): bool operator!() const;
integer.h(275): Integer operator+() const {return *this;}
integer.h(277): Integer operator-() const;
integer.h(279): Integer& operator++();
integer.h(281): Integer& operator--();
integer.h(283): Integer operator++(int) {Integer temp = *this; +
+*this; return temp;}
integer.h(285): Integer operator--(int) {Integer temp = *this; --
*this; return temp;}
integer.h(313): Integer operator>>(size_t n) const {return
Integer(*this)>>=n;}
integer.h(315): Integer operator<<(size_t n) const {return
Integer(*this)<<=n;}
integer.h(360): friend CRYPTOPP_DLL std::istream& CRYPTOPP_API
operator>>(std::istream& in, Integer &a);
integer.h(362): friend CRYPTOPP_DLL std::ostream& CRYPTOPP_API
operator<<(std::ostream& out, const Integer &a);
integer.h(383):inline bool operator==(const CryptoPP::Integer& a,
const CryptoPP::Integer& b) {return a.Compare(b)==0;}
integer.h(385):inline bool operator!=(const CryptoPP::Integer& a,
const CryptoPP::Integer& b) {return a.Compare(b)!=0;}
integer.h(387):inline bool operator(const CryptoPP::Integer& a,
const CryptoPP::Integer& b) {return a.Compare(b)0;}
integer.h(389):inline bool operator>=(const CryptoPP::Integer& a,
const CryptoPP::Integer& b) {return a.Compare(b)>=0;}
integer.h(391):inline bool operator< (const CryptoPP::Integer& a,
const CryptoPP::Integer& b) {return a.Compare(b)< 0;}
integer.h(393):inline bool operator<=(const CryptoPP::Integer& a,
const CryptoPP::Integer& b) {return a.Compare(b)<=0;}
integer.h(395):inline CryptoPP::Integer operator+(const
CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.Plus(b);}
integer.h(397):inline CryptoPP::Integer operator-(const
CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.Minus(b);}
integer.h(399):inline CryptoPP::Integer operator*(const
CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.Times(b);}
integer.h(401):inline CryptoPP::Integer operator/(const
CryptoPP::Integer &a, const CryptoPP::Integer &b) {return
a.DividedBy(b);}
integer.h(403):inline CryptoPP::Integer operator%(const
CryptoPP::Integer &a, const CryptoPP::Integer &b) {return
a.Modulo(b);}
integer.h(405):inline CryptoPP::Integer operator/(const
CryptoPP::Integer &a, CryptoPP::word b) {return a.DividedBy(b);}
integer.h(407):inline CryptoPP::word operator%(const CryptoPP::Integer
&a, CryptoPP::word b) {return a.Modulo(b);}
</OT>

Jun 27 '08 #9
On Apr 29, 5:13*am, jacob navia <ja...@nospam.comwrote:
Hi

I am incorporating 128 Bit integer code into lcc-win and it would be
nice to have some code to test this feature.

Has anyone here code that uses 128 bit integers?

Thanks in advance

P.S. This feature is now native in the 64 bit version, i.e.
not using operator overloading as in the 32 bit version.
This stuff looks to be worth a look:
http://libtom.org/?page=features&new...5&whatfile=tfm
Jun 27 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

41
by: Seth | last post by:
I am in need of source code for the Aho Corasick algorithm. I have tried searching the web but can't seem to find any code. Is there a good site for c code I can search? Thanks in advance.
1
by: Shilpa | last post by:
Hi All, I need C# code needed to open the windows "Open with" dialog Regards, Shilpa
5
by: bromio | last post by:
can someone help me to make code for digital clock using AT89S52. The specs of clock are 12 hour clock,am-pm display,use timer interrupts to have delay.two external inputs to adjust hours and...
0
by: ultradiv | last post by:
I have a VB.NET application partly built that produces an xml output (just a file at present) I have a .NET webserver and SQLserver 2000 I need to be able to send the xml to the webserver/database...
3
by: whatsoever | last post by:
hi i have made a database let say estate agent which have 5 table and 10 queries i have connected it with php using the tutorial in w3school <html> <body> <?php $conn=odbc_connect('db','','');...
3
by: manigattani | last post by:
Please let me know of some java code for converting dbf file to text file
7
by: Bobh | last post by:
I am trying to figure out some code for a report issue; I have an employee who has a incentive scheme. I have a report showing various income amounts and in the report footer I vae totals for...
0
by: Nolanclark | last post by:
Hi there. I've read a previous thread regarding the Old VB 6 checkbox array and how it's not really needed any more. That's fine, but I'm not really sure how to implement the checkbox control array...
8
by: manugm1987 | last post by:
<?xml-stylesheet type="text/xsl" href="ch1.xsl"?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <style type="text/css"> span.cls_002{...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.