Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Miscellaneous
»
Other
»
21237.0 as TDateTime
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Cannot update a record us...
by
egsuh
[
Today
at 01:10:00 am]
Cannot set width and heig...
by
wp
[
Today
at 12:43:43 am]
Fpcupdeluxe
by
TRon
[
Today
at 12:41:04 am]
How to wirte a drag into ...
by
Remy Lebeau
[
Today
at 12:06:16 am]
Using Synchronize in a DL...
by
Remy Lebeau
[March 21, 2025, 11:59:12 pm]
TrayIcon doesn't work usi...
by
CM630
[March 21, 2025, 09:44:23 pm]
"database not open" - IBX...
by
Nicole
[March 21, 2025, 08:25:05 pm]
New 2D StarField
by
Gigatron
[March 21, 2025, 08:06:29 pm]
[maybe SOLVED] BUG in Inp...
by
TRon
[March 21, 2025, 07:49:18 pm]
GTK3 still alpha
by
AlexTP
[March 21, 2025, 07:46:20 pm]
on form drag and drop fil...
by
Remy Lebeau
[March 21, 2025, 07:32:14 pm]
IDE tabs and spaces, auto...
by
chris_laz
[March 21, 2025, 03:58:43 pm]
How to draw a point on a ...
by
wp
[March 21, 2025, 03:09:38 pm]
Checking for number or no...
by
wp
[March 21, 2025, 03:03:28 pm]
Program crashing with exc...
by
rvk
[March 21, 2025, 01:43:23 pm]
File open or File close -...
by
paule32
[March 21, 2025, 01:35:31 pm]
How To: Create and React ...
by
paweld
[March 21, 2025, 01:19:22 pm]
ALSA lib pcm_dmix.c:1000:...
by
Fred vS
[March 21, 2025, 12:42:33 pm]
Converting a Project from...
by
jcmontherock
[March 21, 2025, 11:24:26 am]
Creating Self Signed Cert...
by
Trax
[March 21, 2025, 11:22:19 am]
Lazarus Release Candidate...
by
timppl
[March 21, 2025, 10:23:28 am]
Markdown Processor
by
Roland57
[March 21, 2025, 08:31:53 am]
Uninstall
by
TRon
[March 21, 2025, 08:26:46 am]
Internal error
by
WooBean
[March 21, 2025, 08:18:23 am]
Problemas ao acessar o si...
by
Gustavo 'Gus' Carreno
[March 21, 2025, 03:25:10 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: 21237.0 as TDateTime (Read 1198 times)
Thaddy
Hero Member
Posts: 16653
Kallstadt seems a good place to evict Trump to.
21237.0 as TDateTime
«
on:
February 21, 2024, 07:54:26 am »
Since the above TDateTime value is today exactly many moons ago (66) I treated myself on a little teaser, after the coffee that is:
Code: Pascal
[Select]
[+]
[-]
program
BirthdayParadox
;
{$mode objfpc}
uses
sysutils
,
math
;
function
CalculatePeopleForProbability
(
p
:
Double
)
:
Integer
;
begin
// Approximate the number of people needed for a given probability
Result
:
=
Ceil
(
Sqrt
(
2
*
365
*
Ln
(
1
/
(
1
-
p
)
)
)
)
;
end
;
begin
// Calculate the number of people needed for a 50% probability
// that two people share the same birthday
WriteLn
(
'Number of forum members needed for a 50% probability: '
,
CalculatePeopleForProbability
(
0.5
)
)
;
writeln
(
DateTimeToStr
(
21237.0
)
)
;
end
.
Logged
But I am sure they don't want the Trumps back...
paweld
Hero Member
Posts: 1326
Re: 21237.0 as TDateTime
«
Reply #1 on:
February 21, 2024, 09:02:14 am »
@Thaddy: Happy birthday. Sto lat!
«
Last Edit: February 21, 2024, 08:09:08 pm by paweld
»
Logged
Best regards / Pozdrawiam
paweld
cdbc
Hero Member
Posts: 1964
Re: 21237.0 as TDateTime
«
Reply #2 on:
February 21, 2024, 09:06:20 am »
Hi
A very happy birthday to you Thaddy
Regards Benny
Logged
If it ain't broke, don't fix it
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 3.6 up until Jan 2024 from then on it's both above &: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 4.99
TRon
Hero Member
Posts: 4153
Re: 21237.0 as TDateTime
«
Reply #3 on:
February 21, 2024, 07:40:05 pm »
Happy birthday
Thaddy
and enjoy !
Logged
Today is tomorrow's yesterday.
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Miscellaneous
»
Other
»
21237.0 as TDateTime
TinyPortal
© 2005-2018