Re: [fpc-pascal] Super Large Integer Math Calculations

2017-08-10 Thread Stuart Cox

Have a look at http://www.wolfgang-ehrhardt.de/


On 2017-07-11 6:05 AM, nore...@z505.com wrote:

On 2017-07-07 17:08, Bart wrote:

On 7/7/17, nore...@z505.com  wrote:


For integers beyond 64 bit, or even beyond 32 bit on a 64 bit machine,
why can't the math be broken down into peices the way a human does 
it on

paper, and then theoretically any number can be added and subtracted,
even if it is beyond 32/64 bit?

Example:

type TSuperLargeInt = string;

var
   i, j: TSuperLargeInt;
   output: TSuperLargeInt;
begin
   i := '10009';
   j := '10001';
   output := AddLargeInts(i,j);
   writeln(output);
end.


http://svn.code.sf.net/p/flyingsheep/code/trunk/wtf/ncalc.pp does 
exactly that

(all dependenies are also found at
http://svn.code.sf.net/p/flyingsheep/code/trunk/wtf).

...


It's not lightning fast, but there is room for optimization I guess.

Bart


I knew someone had already invented this!
Any idea if it does square roots, and, decimal point numbers too..

Or, what math can it "not" do.. things like sin/tan/cos, or strange 
maths..


Probably a complex question requiring a complex answer

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Windows API SendMessage()

2017-08-10 Thread Santiago A.

El 10/08/17 a las 13:11, James Richters escribió:

You need to use PostMessage if you want to your program to work correctly. 
SendMessage waits reply and you don't have a message pump in your console 
application, thus a hang happens.

Thank you... PostMessage() works to turn off the display, but for some strange 
reason it can't turn it back on.   I set a 20 second delay, and precisely at 20 
seconds my  monitor light turns green, but then the monitor goes back to sleep 
before the screen can be displayed.  I'm guessing the signal is being sent to 
turn on the monitor, but not to get windows out of power save mode...  I also  
see using -1 to turn the display back on is an un-documented feature.I can 
get the display back on with a keystroke or moving the mouse, but I'm wanting 
the program to turn the display back on without user input.  Can anyone think 
of any other way I could make my console


I have found this:

https://stackoverflow.com/questions/25011141/turn-off-on-monitor-cant-turn-on

It's in c++, but it looks that since w.8, you must simulate a mouse move.

--

Saludos
Santiago A.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Windows API SendMessage()

2017-08-10 Thread James Richters
>You need to use PostMessage if you want to your program to work correctly. 
>SendMessage waits reply and you don't have a message pump in your console 
>application, thus a hang happens.

Thank you... PostMessage() works to turn off the display, but for some strange 
reason it can't turn it back on.   I set a 20 second delay, and precisely at 20 
seconds my  monitor light turns green, but then the monitor goes back to sleep 
before the screen can be displayed.  I'm guessing the signal is being sent to 
turn on the monitor, but not to get windows out of power save mode...  I also  
see using -1 to turn the display back on is an un-documented feature.I can 
get the display back on with a keystroke or moving the mouse, but I'm wanting 
the program to turn the display back on without user input.  Can anyone think 
of any other way I could make my console application to turn the display back 
on without user input?  

I've tried 

progname := FindWindow('displaycontrol', nil);
PostMessage(progname, WM_KEYDOWN, VK_F5, 0);

And while the key sent to the program,  it does not wake the display up.   I 
see other examples of simulating keyboard input, but I haven't been able to get 
them to work in a freepascal console application.

James


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal