Skip to content

Conversation

ewdlop
Copy link
Owner

@ewdlop ewdlop commented Feb 20, 2025

#include <iostream>
#include <ratio>

namesapce ratio

int main() {
    std::ratio<1, 1000000> micro = std::micro();
    std::ratio<1, 1000000000> nano = std::nano();
    std::ratio<1, 1000000000000> pico = std::pico();

    std::cout << "micro: " << micro.num << "/" << micro.den << "\n";
    std::cout << "nano: " << nano.num << "/" << nano.den << "\n";
    std::cout << "pico: " << pico.num << "/" << pico.den << "\n";

    return 0;
}

```cpp
#include <iostream>
#include <ratio>

namespace ratio
{
    int main() {
        std::ratio<1, 1000000> micro = std::micro();
        std::ratio<1, 1000000000> nano = std::nano();
        std::ratio<1, 1000000000000> pico = std::pico();
    
        std::cout << "micro: " << micro.num << "/" << micro.den << "\n";
        std::cout << "nano: " << nano.num << "/" << nano.den << "\n";
        std::cout << "pico: " << pico.num << "/" << pico.den << "\n";
    
        return 0;
    }
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant