Forum > Other

21237.0 as TDateTime

(1/1)

Thaddy:
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  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---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.

paweld:
@Thaddy: Happy birthday. Sto lat!

cdbc:
Hi
A very happy birthday to you Thaddy  :)
Regards Benny

TRon:
Happy birthday Thaddy and enjoy !

Navigation

[0] Message Index

Go to full version