QRandomGenerator64 Class
QRandomGenerator64 클래스를 사용하면 고품질의 시드 없는 난수 생성기에서 64비트 난수 값을 얻을 수 있습니다. 더 보기...
Header: | #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는 32비트 수량을 반환하는 함수 대신 QRandomGenerator::generate64() 함수를 operator()()의 기본값으로 만드는 QRandomGenerator 주변의 간단한 어댑터 클래스입니다. 이 클래스는 32비트 수량 대신 64비트 수량이 필요한 표준 라이브러리 알고리즘과 함께 사용하기 위한 것입니다.
다른 모든 측면에서는 클래스가 동일합니다. 자세한 내용은 QRandomGenerator 의 문서를 참조하세요.
QRandomGenerator도 참조하세요 .
멤버 유형 문서
QRandomGenerator64::result_type
operator()가 반환하는 타입에 대한 타입 정의입니다. 즉, quint64입니다.
operator()도 참조하십시오 .
멤버 함수 문서
quint64 QRandomGenerator64::generate()
64비트 임의의 값 하나를 생성하여 반환합니다.
부호가 있는 정수로 캐스팅할 때 주의할 점: 이 함수가 반환하는 모든 비트는 무작위이므로 가장 중요한 비트가 설정될 확률이 50%입니다. 반환된 값을 qint64로 캐스팅하여 양수로 유지하려면 부호 비트를 마스킹해야 합니다:
QRandomGenerator 및 QRandomGenerator::generate64()도 참조하세요 .
QRandomGenerator64::result_type QRandomGenerator64::operator()()
64비트 난수를 생성하여 반환합니다.
QRandomGenerator::generate() 및 QRandomGenerator::generate64()도 참조하세요 .
© 2025 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.