Arithmetic Operations on Very, Very Long Decimals
I've always been curious: how can I perform arithmetic operations on very long decimals--for example, calculating pi to the 3000th decimal place (especially in an imperative language)? ...
I've always been curious: how can I perform arithmetic operations on very long decimals--for example, calculating pi to the 3000th decimal place (especially in an imperative language)? ...
Adding 15 digit numbers like 999999999999990 in Perl produces results with a period such as 1.9999999999999e+. When using substr it still produces 1.99999999999, and when using BigInt the result still has a period. What is the correct Perl syntax for Perl 5.8.7 to get the result without the period? use BigInt; $acct_hash = substr(($acct...
If I do use a big integer in substr: use BigInt; $acct_hash = substr(('99999999999912345' + $data[1]),0,15); why is the result still 9.9999999999912? I was expecting 999999999999912. Is there something like: $data[1] = substr(to_char('999999999999991234'),0,15); in Perl? ...
I am attempting to hash a string to a 64-bit value (bigint) in MySQL. I am aware of the MD5() function, which returns a 128-bit hash as a binary string. I'd be happy to just take the bottom or top 64 bits of this result. However, I cannot figure out how to get from a binary string type to a numeric type of any sort. Any pointers? ...
I have a Sqlite database that I am using as an ado.net job store for my Quartz.net scheduler jobs. In one table, a column called START_TIME is of type big int. Is there a way to cast or convert a bigint to a date value? I would like to be able to query the database to see which jobs are scheduled at what date/time and a value such as...
When I try to get the sum of a column from a table I get the error 'Arithmetic overflow error converting expression to data type int' because the resulting number is to big for an INT. So I tried to CAST to a BIGINT using SELECT CAST(SUM(columnname) AS BIGINT) FROM tablename but I get the same error. Any ideas what i'm doing wrong? ...
recently i use int64. but it's no more handle my data. so I want something like BigInt. any idea? ...
I'm running into a problem because my database has BIGINT data (64-bit integers) but the version of PHP I'm running is only 32-bit. So when I pull out value from a table I end up with a numeric string representing a 64-bit integer in base 10. What I would ideally like to do is use the 64-bit integer as a bitmask. So I need to go to ei...
I've got four unsigned 32-bit integers representing an unsigned 128-bit integer, in little endian order: typedef struct { unsigned int part[4]; } bigint_t; I'd like to convert this number into its decimal string representation and output it to a file. Right now, I'm using a bigint_divmod10 function to divide the number by 10, kee...
I have a problem with the Java BigInteger class: I can't paste a large value into BigInteger. For example, let's say I want to assign a BigInteger to this number: 26525285981219105863630848482795 I cannot assign it directly, because the compiler thinks it's an integer: val bi = 26525285981219105863630848482795 //compile error But I...
Hi, what I am suppose to use when handling a value in c#, which is bigint SQLSERVER DB ? Thanks ...
In C++, I have a bigint class that can hold an integer of arbitrary size. I'd like to convert large float or double numbers to bigint. I have a working method, but it's a bit of a hack. I used IEEE 754 number specification to get the binary sign, mantissa and exponent of the input number. Here is the code (Sign is ignored here, that's...
Hi All, I'm aware of a number of BigInt libraries for C on various platforms and how to use them but I'm intrigued: how do they work? How would I go about building my own library (I'm not going to try, no point re-inventing the wheel but I'm interested in how it might happen)? Can anyone point me towards tutorials etc that might explain...
I'm doing a facebook connect integration. I use the facebook php library to get the uid,like $facebook = new Facebook($api_key, $secret); $fb_user = $facebook->require_login(); $fbuser is a 16-character long bigint, such as 1000002949493949 However, when I insert this value into mysql it only inserts 2949493949 So later when I try to...
I'm building a small BigInt library in C++ for use in my programming language. The structure is like the following: short digits[ 1000 ]; int len; I have a function that converts a string into a bigint by splitting it up into single chars and putting them into digits. The numbers in digits are all reversed, so the number 123 woul...
I have two tables with 10-20 million rows that have GUID primary keys and at leat 12 tables related via foreign key. The base tables have 10-20 indexes each. We are moving from GUID to BigInt primary keys. I'm wondering if anyone has any suggestions on an approach. Right now this is the approach I'm pondering: Drop all indexes and ...
I want to store a C#.NET ulong into a T-SQL database. I don't see any provisions for doing this, as the SQL bigint has the same Min/Max values as a normal long. Is there any way I can do this? Or is catching an OverflowException my only hope? ...
i am using php and running sql queries on a mysql server. in order to prevent sql injections, i am using mysql_real_escape_string. i am also using (int) for numbers casting, in the following manner: $desired_age = 12; $query = "select id from users where (age > ".(int)$desired_age.")"; $result = mysql_query($query); that work. But,...
Hi, I am trying to calculate 100! I am looking for the simplest way to accomplish this using C. I have read around but have not found a concrete answer. If you must know, I program in Xcode in Mac os X. Thanks! ...
I'm attempting to use LAST_INSERT_ID on an auto incremented index that has moved past the signed int value 2147483647. This column is an unsigned int. However, LAST_INSERT_ID() is returning an invalid negative value. Researching this, I've found a couple comments indicating this is the nature of this function. But I cannot find it offici...