QRandomGenerator64 Class
QRandomGenerator64 클래스를 사용하면 시드가 필요 없는 고품질의 난수 생성기를 통해 64비트 난수를 얻을 수 있습니다. 더 보기...
| 헤더: | #include <QRandomGenerator64> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
| 상속: | QRandomGenerator |
공개 유형
공개 함수
| quint64 | generate() |
| QRandomGenerator64::result_type | operator()() |
상세 설명
QRandomGenerator64는 ` QRandomGenerator`을 감싸는 간단한 어댑터 클래스로, ` operator()`의 기본 함수를 32비트 값을 반환하는 함수 대신 ` QRandomGenerator::generate64()`로 설정합니다. 이 클래스는 32비트 대신 64비트 값이 필요한 표준 라이브러리 알고리즘과 함께 사용하도록 설계되었습니다.
그 외 모든 측면에서는 이 클래스가 동일합니다. 자세한 내용은 QRandomGenerator 의 문서를 참조하십시오.
QRandomGenerator도 참조하십시오 .
멤버 유형 문서
QRandomGenerator64::result_type
operator()가 반환하는 유형에 대한 typedef입니다. 즉, quint64입니다.
operator()도 참조하십시오 .
멤버 함수 설명서
quint64 QRandomGenerator64::generate()
64비트 난수 값 하나를 생성하여 반환합니다.
부호 있는 정수로 형변환할 때의 주의 사항: 이 함수가 반환하는 모든 비트는 무작위이므로, 최상위 비트가 설정될 확률은 50%입니다. 반환된 값을 qint64로 형변환하고 양수를 유지하려면 부호 비트를 제거해야 합니다:
QRandomGenerator 및 QRandomGenerator::generate64()도 참조하십시오 .
QRandomGenerator64::result_type QRandomGenerator64::operator()()
64비트 난수를 생성하여 반환합니다.
QRandomGenerator::generate() 및 QRandomGenerator::generate64()도 참조하십시오 .
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.