Questions tagged [bignum]

Common computer-jargon term to refer to arbitrary-precision math and data-types. The term "arbitrary-precision" refers to the ability of a machine to perform numerical computations whose precision is limited only by the available memory.

362 questions
0
votes
3 answers

Convert big hexadecimal to decimal numbers

I have a big hexadecimal number, for example CD4A0619FB0907BC00000 (25!) or any other number like this. Now, using standard C/C++ code only (no libraries like Boost), I want to convert this number to the decimal number 15511210043330985984000000.…
sigalor
  • 901
  • 11
  • 24
0
votes
1 answer

Recognizing floating point in double variable

I have a problem with big numbers in double variables. Imagine I have 3 numbers like this: 124.556321466 120.00 1.79769313486232E+308 I just want to recognize item 2 or those numbers that don't have any valuable number after floating point. In…
andrew
  • 13
  • 4
0
votes
1 answer

Rails Postgreql change int to bignum on column

I have a field in a table that was originally set as integer. It is an ID from a an external data source. Now using multiple datasources some of the ID values are very large integers, larger than postgres 4bit default. What is the best way to…
lacostenycoder
  • 10,623
  • 4
  • 31
  • 48
0
votes
2 answers

Can some help me figure out why my zeroes are not appending?

So I've been working on this BigNum multiplication method (in short the method takes in a BigNum other and is supposed to return the product of two large positive integers without using the bigint class) for a while and I'm almost done however, I am…
user4147933
  • 15
  • 2
  • 4
0
votes
1 answer

using array to store big numbers

i'm newbie in C programming . i have written this code for adding two numbers with 100 digits , but i don't know why the code does not work correctly , it suppose to move the carry but it doesn't . and the other problem is its just ignoring the…
Mohammad Siavashi
  • 1,192
  • 2
  • 17
  • 48
0
votes
2 answers

With Ruby, where to use NOT, AND, OR, XOR operations for Fixnum or Bignum?

Just wondering if anyone has any realworld examples or know when you might use the NOT, AND, OR, XOR, <<, >> operators in Ruby. I've been programming for 4 years and never come across the need to use any of these, wondering how common actual usage…
Jason
  • 22,645
  • 5
  • 29
  • 51
0
votes
1 answer

wrong BIGNUM initialization in OpenSSL

I have a code like this: BIGNUM *p = BN_new(), *B = BN_new(), *a = BN_new(), *ret = BN_new(); BN_bin2bn((uchar*)"\x01\x02\0x03\0",3,p); BN_bin2bn((uchar*)"\x02\x03\0x04\0",3,B); BN_bin2bn((uchar*)"\x03\x04\0x05\0",3,a); Print_Format("p:…
Taha Paksu
  • 15,371
  • 2
  • 44
  • 78
0
votes
1 answer

Prepros - C:bignum to big to convert into `long'

I launch the Prepros application to compile scss in css. But this error appear : RangeError on line ["87"] of C: bignum too big to convert into `long' Run with --trace to see the full backtrace C:\Users\me\Desktop\FFF-Bootstrap\scss\style.scss How…
Tristan
  • 33
  • 1
  • 6
0
votes
1 answer

How to cut a mpz_t into two parts using GMP lib on C?

Using GMP on c, I have a big integer "mpz_t n" in decimal form, how can I cut it into 2 parts? In fact, these 2 parts should have the same length in binary. For example, maybe I can convert the n to a binary of 112bits, then I want to cut it into…
allenzzzxd
  • 331
  • 1
  • 10
  • 24
0
votes
1 answer

BigNum code in c++

I wrote this code to work with big integer: the sum function work correctly but the multiple function doesn't work. Can anyone help me to fix my problem?
amirhbv
  • 17
  • 4
0
votes
4 answers

Adding negative and positive numbers in java without BigInt

i'm trying to write a small java class. I have an object called BigNumber. I wrote method that add two positive numbers, and other method that subract two also positive numbers. Now i want them to handle negative numbers. So the i wrote couple of…
user256262
0
votes
1 answer

Iterating through a bignum - Ruby

I have a 309 digit integer, I want to iterate through its characters. Currently I am using: require 'openssl' e =…
Derptacos
  • 179
  • 10
0
votes
1 answer

Will Erlang have Bignums for math functions?

Why does Erlang not include arbitrary precision for math functions? I recently had to use math:pow(2,4333), and it throws an error. Why does Erlang not use libraries like GMP? Are there any plans to include it in the standard library? (Haskell uses…
user235273
0
votes
3 answers

Bignum overflow error after Euler #2 attempt

I've attempted to solve Euler Problem 2 with the following tail recursive functions: (defun fib (num) (labels ((fib-helper (num a b) (cond ((or (zerop num) (eql num 1)) a) (t (fib-helper…
category
  • 2,113
  • 2
  • 22
  • 46
0
votes
0 answers

Performance of Euler - Van Wijngaarden and sumalt transformations in conjunction with binary splitting

Given an acceleration structure like binary splitting, how well do acceleration transformations like Euler-Wijngaarden or sumalt perform when used side-by-side with it? https://en.wikipedia.org/wiki/Van_Wijngaarden_transformation The sumalt…
user2464424
  • 1,536
  • 1
  • 14
  • 28