MS VC Developer Studio 2003.
I have some rather large integer numbers, 128 bits, I need to crunch. I
need to be able to add, subtract, multiply, and divide. In no case would
the result exceed 128 bits. Test for equal, greater than, less than.
I would use _int128 if it existed.
The values are currently in byte arrays such as:
unsigned char value[16];
arranged little endian (least significant first).
Anyone know of a quick and easy way to do this?
Thanks,
Bruce. 5 5586
Bruce. wrote:
MS VC Developer Studio 2003.
That's irrelevant here, unfortunately.
I have some rather large integer numbers, 128 bits, I need to crunch.
I need to be able to add, subtract, multiply, and divide. In no case
would the result exceed 128 bits. Test for equal, greater than, less
than.
I would use _int128 if it existed.
It doesn't. We feel your pain. Next time you will need _int256 or
_int1024. It doesn't mean the language is going to have it, though.
So, you're stuck rolling your own or getting a working solution from
a third party.
The values are currently in byte arrays such as:
unsigned char value[16];
arranged little endian (least significant first).
Anyone know of a quick and easy way to do this?
Look up "arbitrary precision integer arithmetic" on the Web.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Bruce. wrote:
MS VC Developer Studio 2003.
I have some rather large integer numbers, 128 bits, I need to crunch. I
need to be able to add, subtract, multiply, and divide. In no case would
the result exceed 128 bits. Test for equal, greater than, less than.
I would use _int128 if it existed.
The values are currently in byte arrays such as:
unsigned char value[16];
arranged little endian (least significant first).
Anyone know of a quick and easy way to do this?
One example that might help you is the 64 bit math routines in the GD
library source. They could be updated to do 128 bit using int64_t.
--
Ian Collins.
On May 29, 11:53 am, "Bruce." <n...@nowhere.comwrote:
MS VC Developer Studio 2003.
I have some rather large integer numbers, 128 bits, I need to crunch. I
need to be able to add, subtract, multiply, and divide. In no case would
the result exceed 128 bits. Test for equal, greater than, less than.
I would use _int128 if it existed.
The values are currently in byte arrays such as:
unsigned char value[16];
arranged little endian (least significant first).
Anyone know of a quick and easy way to do this?
I have a set that use the arbitrary length integer math often found in
cryptography libaries. I haven't needed int256, yet. E-mail me at
michravera at yahoo dot com and we can talk.
"Ian Collins" <ia******@hotmail.comwrote in message
news:5c**************@mid.individual.net...
One example that might help you is the 64 bit math routines in the GD
library source. They could be updated to do 128 bit using int64_t.
Sorry, what is GD library source?
Bruce.
Bruce. wrote:
"Ian Collins" <ia******@hotmail.comwrote in message
news:5c**************@mid.individual.net...
>One example that might help you is the 64 bit math routines in the GD library source. They could be updated to do 128 bit using int64_t.
Sorry, what is GD library source?
Try the first hit on a google for "gd library".
--
Ian Collins. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Frank Millman |
last post by:
Hi all
I was helping my niece with her trigonometry homework last night. Her
calculator's batteries were flat, so I thought I would use Python's
math module to calculate sin, cos, and tan.
I tried the example in the text book first, to ensure that I was
getting the correct result, but it did not agree. Then my wife had the
idea of using...
|
by: Jussi Mononen |
last post by:
Hi,
I'm having problems to successfully execute the test scripts on a
Compaq host ( OSF1 tr51bdev V5.1 2650 alpha ). Almost all tests end up
with the following error message
"PARI: *** Invalid arguments to divll. at test_eng/Testout.pm line
30.
...propagated at t/polyser.t line 9.
t/polyser.....dubious
|
by: limelight |
last post by:
I have discovered a math error in the .NET framework's Log function. It
returns incorrect results for varying powers of 2 that depend on whether the
program is run from within the IDE or from the command line. The amount by
which the calculation is off is very small; even though the double data type
holds the errant value, it seems to round...
|
by: cwdjrxyz |
last post by:
Javascript has a very small math function list. However there is no
reason that this list can not be extended greatly. Speed is not an
issue, unless you nest complicated calculations several levels deep. In
that case you need much more ram than a PC has to store functions
calculated in loops so that you do not have to recalculate every time...
|
by: bravesplace |
last post by:
Hello,
I am using the folling funtion to round a number to a single digit on
my form:
function round1(num)
{
return Math.round(num*1)/1
}
| |
by: Gregory Pietsch |
last post by:
I'm writing a portable implementation of the C standard library for
http://www.clc-wiki.net and I was wondering if someone could check the
functions in math.h for sanity/portability/whatever. I'm almost halfway
through writing the over 200 functions needed to implement C99's
version of math.h, and I would like to have some feedback and/or...
|
by: Sambo |
last post by:
I have the following module:
-------------------------------
import math
def ac_add_a_ph( amp1, ph1, amp2, ph2 ):
amp3 = 0.0
ph3 = 0.0
ac1 = ( 0, 0j )
ac2 = ( 0, 0j )
|
by: kirby.urner |
last post by:
Cyber-curricula have a leveling aspect, as kids
nearer Katrina's epicenter tune in and bliss out
on 'Warriors of the Net' (why wait for stupid big
dummy textbooks to catch up?). They feel more
empowered by Python and Ubuntu than by any
King's English I'd warrant, given how the latter
has been dumbed down (slowed, degraded) by
unimaginative...
|
by: =?Utf-8?B?UmVuZQ==?= |
last post by:
Hello everyone
I have a problem with Math.Round, it´s ocurring some strange:
Math.Round(12.985) = 12.98, it´s wrong. It should be: 12.99
Why?? What is the problem?
Help ME !!!!
|
by: bH |
last post by:
Hi All,
I have been looking at javascript drawing from this website :
http://www.cwdjr.net/geometricDraw/pentagon_draw.html"
and I am wondering why the author made it
into two images : upper half then lower half?. Is there a rule that
says
you can't do it in one set of calculated values for all the points as
the points
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |