acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
aaa_hour.h
1// Created by camilo on 2021-10-05 12:45 BRT <3ThomasBorregaardSorensen!![ THE ONE GOD ]
2#pragma once
3
4//
5//class CLASS_DECL_ACME floating_hour_t :
6// public floating_hour
7//{
8//public:
9//
10//
11// using BASE_TYPE = floating_hour;
12//
13//
14// constexpr floating_hour_t(floating_hour hour = {}) : floating_hour(hour) {}
15//
16//
17// integral_second integral_seconds() const { return integral_second((::i64)(m_f64 * 3'600.0)); }
18// integral_nanosecond integral_nanoseconds() const { return integral_nanosecond((::i64)(fmod(m_f64 * 3'600.0, 1.0) * 1'000'000'000.0)); }
19//
20//
21//};
22//
23//
24//using floating_hour = floating_time < floating_hour_t >;
25//
27//constexpr floating_hour operator""_h(::f128 d) { return (floating_hour)d; }
28//constexpr floating_hour operator""_hour(::f128 d) { return (floating_hour)d; }
29//constexpr floating_hour operator""_hours(::f128 d) { return (floating_hour)d; }
30
31
32inline floating_hour get_floating_hour() { return floating_hour(get_floating_nanosecond().m_f64 / 3'600'000'000'000.0); }
33
34
35template < >
36inline floating_hour now<floating_hour>()
37{
38
39 return get_floating_hour();
40
41}
42
43
44