Alan Mead wrote:
...
I was hoping that the algorithms underlying the RTL.Randomize and
RTL.Random would switch to using MT in fpc version 2.
-Alan
Reading comments in rtl/inc/system.inc FPC 1.9.x uses Mersenne Twister.
Commited to CVS on 2003/10/26 by Jonas.
--
Michalis
_
Alan Mead <[EMAIL PROTECTED]> wrote:
> I was hoping that the algorithms underlying the RTL.Randomize and
> RTL.Random would switch to using MT in fpc version 2.
Here's the post I recalled:
http://www.mail-archive.com/[EMAIL PROTECTED]/msg01565.html
Is this still the case that 1.9.x implements M
Jeff,
Thanks for this link. I found a Pascal implementation of MT
somewhere .. not this one I think. Is it your code? Do you know the
difference between the Real1() and Real2() etc. methods?
I was hoping that the algorithms underlying the RTL.Randomize and
RTL.Random would switch to using MT i
Alan Mead <[EMAIL PROTECTED]> wrote:
> I don't know if this is really a bug or whether it's known... I
> have
> this line of code:
>
> while ( (i<=Length(fmt)) and (NOT fmt[i] IN ['0'..'9']) ) do
> inc(i);
>
> It compiles fine but I get a RTE:
>
> An unhandled exception occurred at 0x0807B18
> Last time I compared FPC's random() to MT, MT was a clear winner.
Have you tried this ?
http://daniel.taickim.net/development/mtwister.pp
__
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail
On Wed, 29 Sep 2004, Jilani Khaldi wrote:
> > Or, simpler, use DecodeDateTime function from DateUtils unit. It's
> even Delphi-compatible. I'm not sure whether it exists in FPC 1.0.x
> (even if not, it's probably
> > possible to just compile DateUtils unit sources from FPC 1.9.4 using
> FPC
>It's a lot simpler to use simply SysUtils.DecodeDate and DeccdeTime.
Uses SysUtils;
var Year, Month, Day, hour,minute,second,msec : word;
begin
decodedate(trunc(thetdatetime),year,month,day);
decodetime(frac(thetdatetime),hour,minute,second,msec);
end;
Well, I want to use the double value as
Hi All,
In the next issue of Linux&C n.42 (http://www.oltrelinux.com) there will
be the first article (Special) about Free Pascal (8 pages for this
article, never happened before with other cool languages). Linux&C is
the number one magazione in Italy dedicated to Linux with nearly 50.000
reade
> Or, simpler, use DecodeDateTime function from DateUtils unit. It's
even Delphi-compatible. I'm not sure whether it exists in FPC 1.0.x
(even if not, it's probably
> possible to just compile DateUtils unit sources from FPC 1.9.4 using
FPC 1.0.10), but it exists in FPC 1.9.x for sure.
I know I c
I believe that your code is being interpreted as:
(NOT fmt[i]) in ['0'..'9']
instead of the intended NOT (fmt[i] in ['0'..'9'])
Pascal's rules for parsing logical expressions differ from the standard rules of the
propositional calculus (i.e. modern symbolic logic). Thus, this behavior is "by
d
Alan Mead a écrit :
>
> I don't know if this is really a bug or whether it's known... I have
> this line of code:
>
> while ( (i<=Length(fmt)) and (NOT fmt[i] IN ['0'..'9']) ) do
> inc(i);
>
> It compiles fine but I get a RTE:
>
> An unhandled exception occurred at 0x0807B180 :
> EVariantErro
> > Or you might scan the strings created by DateToStr. That'd be
> > quick-n-dirty, though :-)
> >
> > Anton.
> >
>
> Or, simpler, use DecodeDateTime function from DateUtils unit. It's even
> Delphi-compatible. I'm not sure whether it exists in FPC 1.0.x (even if
> not, it's probably possibl
On Wed, 29 Sep 2004, Anton Tichawa wrote:
> Michael Van Canneyt wrote:
>
> >On Wed, 29 Sep 2004, Jilani Khaldi wrote:
> >
> >
> >
> >>Hi All,
> >>Does somebody kown the algorithm to convert a date from the double
> >>format to an explicit format?
> >>Example: the function "now" givers me: 3.
Alan Mead a écrit :
>
> I don't know if this is really a bug or whether it's known... I have
> this line of code:
>
> while ( (i<=Length(fmt)) and (NOT fmt[i] IN ['0'..'9']) ) do
> inc(i);
>
> It compiles fine but I get a RTE:
>
> An unhandled exception occurred at 0x0807B180 :
> EVariantErro
Anton Tichawa wrote:
Michael Van Canneyt wrote:
On Wed, 29 Sep 2004, Jilani Khaldi wrote:
Hi All,
Does somebody kown the algorithm to convert a date from the double
format to an explicit format?
Example: the function "now" givers me: 3.825956615197917E+004
I want to transform it in: year-month-
> Michael Van Canneyt wrote:
>
> >
> >
> Or, if you need the values for some sort of calculation, you have to
>
> - find out the reference date, i. e. DateToStr(0)
> - and the scale, (I think 1.0 = 1 day)
> - consider the month lengths, with february changing in leap years
> - for historic date
Michael Van Canneyt wrote:
On Wed, 29 Sep 2004, Jilani Khaldi wrote:
Hi All,
Does somebody kown the algorithm to convert a date from the double
format to an explicit format?
Example: the function "now" givers me: 3.825956615197917E+004
I want to transform it in: year-month-day
Why not
Thanks for all the suggestions.
Right, if my program were to execute cntinuously while it generated
these random numbers, it would be easy to just call randomize once.
But my program runs very quickly and I'd like it to produce very
random numbers even upon repeated execution of the program. If
On Wed, 29 Sep 2004, Jilani Khaldi wrote:
> Hi All,
> Does somebody kown the algorithm to convert a date from the double
> format to an explicit format?
> Example: the function "now" givers me: 3.825956615197917E+004
> I want to transform it in: year-month-day
Why not use DateToStr() or F
Hi All,
Does somebody kown the algorithm to convert a date from the double
format to an explicit format?
Example: the function "now" givers me: 3.825956615197917E+004
I want to transform it in: year-month-day
Thanks!
Jilani
___
fpc-pascal maillist
On 29 sep 2004, at 08:36, Alan Mead wrote:
It's known that Randomize() is not effective when called rapidly...
Why do you want to call randomize rapidly? Reading a numbers from
/dev/random is semantically closer to calling random() a lot than to
calling randomize() a lot.
Jonas
_
Alan Mead wrote:
It's known that Randomize() is not effective when called rapidly... I
tried to solve this using the code sample below. I can cat /dev/null
(without becoming root) but when I run the code below I get an access
denied RTE at 'Reset(f,1);'.. this code works fine when run as
/dev/rand
22 matches
Mail list logo