# Re: CalDat

```Ben Tupper <pemaquidriver@tidewater.net> wrote in message
3B017E66.BD5C9F6D@tidewater.net">news:3B017E66.BD5C9F6D@tidewater.net...
> Hello,
>
>
> 1)   Unless the Julian Day Number is double precision, the
> minute and hour are always zero.
> 2)   I don't believe the hour is correctly determing when
> the Julian Day number is provided as single precision.
> If the Julian Day begins at 1200 on a given day, then 0.36 *
> 24 + 12 = 20.6  (fraction of day * hours per day + offset =
> hour number of day)

I don't think it is a bug. Single precision numbers only give you
0.25 in terms of julian days

Check out the following code

print,'Singl prec #:'
print,float(2529161.36d),format='(f50.25)'

CALDAT,2529161.36d, Month, Day, Year, Hour, Minute,Second
PRINT, 'Doubl:           ',Month, Day, Year, Hour, Minute, Second

CALDAT, 2529161.36, Month, Day, Year, Hour, Minute,Second
PRINT, 'Float:             ',Month, Day, Year, Hour, Minute, Second

CALDAT, 2529161.25d, Month, Day, Year, Hour, Minute,Second
PRINT, 'Round Doub:',Month, Day, Year, Hour, Minute, Second

print,'Next Singl prec #:'
print,float(2529161.45d),format='(f50.25)'

CALDAT,2529161.45d, Month, Day, Year, Hour, Minute,Second
PRINT, 'Doubl:           ',Month, Day, Year, Hour, Minute, Second

CALDAT, 2529161.45, Month, Day, Year, Hour, Minute,Second
PRINT, 'Float:             ',Month, Day, Year, Hour, Minute, Second

CALDAT, 2529161.5d, Month, Day, Year, Hour, Minute,Second
PRINT, 'Round Doub:',Month, Day, Year, Hour, Minute, Second

;****************** Results Below *****************************************

Singl prec #:
2529161.2500000000000000000000000
Doubl:                      7           4        2212          20
38       23.999989
Float:                        7           4        2212          18
0      0.00000000
Round Doub:           7           4        2212          18           0
0.00000000

Next Singl prec #:
2529161.5000000000000000000000000
Doubl:                      7           4        2212          22
48  1.6093257e-005
Float:                        7           5        2212           0
0      0.00000000
Round Doub:           7           5        2212           0           0
0.00000000

Cheers,
bob stockwell

```

• References: