LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Power of function with very large numbers & HEX array

Solved!
Go to solution

@Jordan_M wrote:

Here is an example that calculates m^n for large numbers.  It is based on the suggestions posted above.  It only works with bases up to 4*10^9..


So, it it supposed to work for the problem in post 1? Seems to give the wrong result.

0 Kudos
Message 21 of 34
(2,741 Views)

Seems my old code from the N'th root challenge seems to work just fine. It uses the exponentiation by squaring method.

 

 

 

Looking at it, it could be made much more efficient. 😉

0 Kudos
Message 22 of 34
(2,739 Views)

Hi everyone,

 

thank you for answers and help, but it seems that I really have Super Bug in my brain because I still did not manage to get this thing going and I still don't see the way how I can use that big reusult (result is string) to use for further calculation of mod --> (982451653^15) mod 1287821 and I don't know what to do next... 

0 Kudos
Message 23 of 34
(2,714 Views)

I'm curious about why you're trying to solve this problem.  Is it a school assignment?  Are you working on a real-world application with such large numbers?  That'd be interesting. 😄  What is it?  What is the physical significance of the calculation you're trying to perform?  Inquiring minds want to know!

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 24 of 34
(2,703 Views)

@SuperbrainBug wrote:

 

[...] and I don't know what to do next... 


  1. Solve the problem by hand on a piece of paper, paying attention to the steps you take.
  2. Implement the procedure followed in step 1 with LabVIEW.

I think someone has already said this.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 25 of 34
(2,698 Views)

It's a school assignment... I need to calculate that for diffie-hellman key exchange

Message 26 of 34
(2,686 Views)

Why LabVIEW, then?

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 27 of 34
(2,673 Views)

Because we are communicating over serial port (VISA) with one ticket printer and ticket printer uses diffie-hellman key exchange

0 Kudos
Message 28 of 34
(2,659 Views)
Solution
Accepted by topic author SuperbrainBug

LabPython will work.  All you need is the dll and OpenG's free library.

 

PyMath2.png

 

The modulo result I get is 156086.  Is this what you expect?

 

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 29 of 34
(2,647 Views)
Solution
Accepted by topic author SuperbrainBug

Average time 30 microseconds?  Did I do this correctly?

 

PyMath2.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 30 of 34
(2,640 Views)